PDA

View Full Version : سوال: عدم نمایش اطلاعات در DropDownList



forodo
پنج شنبه 10 مهر 1393, 12:32 عصر
سلام
من با کدهای زیر اطلاعات رو داخل DropDownList میریزم ولی چیزی نشون نمی ده.
SqlConnection con = new SqlConnection(System.Configuration.ConfigurationMa nager.ConnectionStrings[""].ConnectionString);
SqlDataAdapter da = new SqlDataAdapter();
DataTable dt = new DataTable();
da.SelectCommand = new SqlCommand();

da.SelectCommand.Connection = con;
da.SelectCommand.CommandType = CommandType.Text;
da.SelectCommand.CommandText = @"SELECT ID, TypeOfTraining
FROM tblTypeOfTraining";
con.Open();
da.Fill(dt);
con.Close();

ddlTypeOfTraining.DataSource = dt;

alirezahf
جمعه 11 مهر 1393, 13:10 عصر
ddlTypeOfTraining.DataBind();

اینم ب آخرش اضافه کن