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"); conn.Open(); SqlCommand sc = new SqlCommand("select ClassName from SchoolClass", conn); SqlDataReader reader; reader = sc.ExecuteReader(); DataTable dt = new DataTable(); dt.Columns.Add("ClassName", typeof(string)); dt.Load(reader); drpclass.SelectedValue = "ClassName"; drpclass.DataSource = dt; conn.Close(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)