forodo
پنج شنبه 10 مهر 1393, 13: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;
من با کدهای زیر اطلاعات رو داخل 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;