TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
SWAMY YT
877
643
30.6k
Dropdown results in Empty = "Enumeration yielded no results"
Sep 5 2018 1:02 AM
hello, i have been try to retrieve the data from the database, but it results in Empty = "Enumeration yielded no results" any solutions. here is my code,
public void DiametrDropDown()
{
// string CS = ConfigurationManager.ConnectionStrings[""].ConnectionString;
// string data = "select PHYSICAL_ID,SUBSTRING(MODEL,6,len(MODEL)) as Model from PHYSICAL_DATA_PSYCHOLMETRICS as P";
SqlCommand cmd = new SqlCommand("select PHYSICAL_ID,SUBSTRING(MODEL,6,len(MODEL)) as Model from PHYSICAL_DATA_PSYCHOLMETRICS as P", conn);
conn.Open();
DDLDiameter.DataSource = cmd.ExecuteReader();// where the result from the query is assigned to the dropdown id
DDLDiameter.DataTextField = "Model";
DDLDiameter.DataValueField = "PHYSICAL_ID";
DDLDiameter.DataBind();
conn.Close();
}
<asp:DropDownList ID="DDLDiameter" runat="server" ></asp:DropDownList>
<asp:requiredfieldvalidator id="RqdDiameter1" runat="server" ControlToValidate="DDLDiameter" ErrorMessage="Please Select Diameter" Text="*" ForeColor="Red"></asp:requiredfieldvalidator>
</td>
Reply
Answers (
2
)
How to preview a pdf document on mouse over using js/ jquery
How to do Nunit Testing with ivr