<pre> SqlConnection con = new SqlConnection(@"Data Source=AQSASHAIKH\SQLEXPRESS;Initial Catalog=Client;Integrated Security=True"); string com = "Select * From [dbo].[client]"; SqlDataAdapter da = new SqlDataAdapter(com, con); DataTable dt = new DataTable(); da.Fill(dt); DropDownList1.DataSource = dt; DropDownList1.DataBind(); DropDownList1.DataTextField = "Name"; DropDownList1.DataValueField = "id"; DropDownList1.DataBind(); SqlConnection Conn = new SqlConnection(@"Data Source=AQSASHAIKH\SQLEXPRESS;Initial Catalog=Client;Integrated Security=True"); SqlCommand Comm1 = new SqlCommand(com, Conn); Comm1.Connection = Conn; Comm1.CommandText = "SELECT COUNT(*) FROM client"; Conn.Open(); TxtBox1.Text = Comm1.ExecuteScalar().ToString(); TxtBox2.Text = Comm1.ExecuteScalar().ToString(); Conn.Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)