I tried several times in combobox data is not retireved from the databaseMy code as follows
In pageload i written the below code as follows
SqlConnection conn = new SqlConnection(@"Data Source=DOCTOR\SQLEXPRESS;Initial Catalog=Testing;User ID=sa;Password=a");
SqlCommand sc = new SqlCommand("select Designation from Designations where active <> 'd'", conn);
reader = sc.ExecuteReader();
DataTable dt = new DataTable();
ComboBox1.DataTextField = "Designation";
ComboBox1.DataValueField = "Designation";
ComboBox1.DataSource = dt;
In database records as follows (Table name Designations )
ID Name Designation
1 Raj Course Officer
2 Ramesh Authorised signatoury
In run mode as follows
But in combobox designation is not displayed.
i tried several time but in combobox designation is not shown.
please help me what is the problem in my above code.