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();
}
Jenith ThakkarPosted Sep 5, 2018, 1:35 AM
And Try again
Rafnas T PPosted Sep 5, 2018, 4:15 AM