I did drop down list that fill its value from database But when it run it dose not get first row and get others and if I add new it get it what is the problem?
private void LoadWithCategory()
{
if (Request.QueryString["Category_Id"] != null)
{
using (SqlConnection Con = Connection.GetConnection())
{
SqlCommand Com = new SqlCommand("GetProducFamilyTP", Con);
Com.CommandType = CommandType.StoredProcedure;
Com.Parameters.Add(
Parameter.NewInt("@Category_Id", Request.QueryString["Category_Id"]));
SqlDataReader DR = Com.ExecuteReader();
if (DR.Read())
{
DDLProductFamily.DataSource = DR;
DDLProductFamily.DataTextField = "Name";
DDLProductFamily.DataValueField = "ProductCategory_Id";
DDLProductFamily.DataBind();
}
else
{
DDLProductFamily.Visible = false;
}
}
}
}