i am making school website in which i want that when new class add in database then auto fill that class in combobox of student registration form during Form load.
here is my code but it doesnot work.
can any body help me that problem?
thanks in advance.
protected void Page_Load(object sender, EventArgs e)
SqlConnection conn = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=D:\Final Project\FinalProject\FinalProject\App_Data\Record.mdf;Integrated Security=True;User Instance=True");
SqlCommand sc = new SqlCommand("select ClassName from SchoolClass", conn);
reader = sc.ExecuteReader();
DataTable dt = new DataTable();
drpclass.SelectedValue = "ClassName";
drpclass.DataSource = dt;
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)