i am develop one web application in this web application has 8 textboxes
and also i have the sql server2005 i created the one database i write
the code date base connection and application is running time the sqlserver
database not connected how to solve but not given the any error i am copied
code
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection connect=new SqlConnection("Data Source=ADMIN-E41B7B0DB\\SQLEXPRESS;Initial Catalog=agfl;connect timeout=30;Integrated Security=True");
SqlCommand mycommand;
mycommand= new SqlCommand("Insert into pac(sno,rdate,acno,name,vno,amt,chno,edate) values('"+TextBox1.Text+"','"+TextBox5.Text+"','"+TextBox2.Text+"','"+TextBox6.Text+"','"+TextBox3.Text+"','"+TextBox7.Text+"','"+TextBox4.Text+"','"+TextBox8.Text+"')", connect );
connect.Open();
TextBox3.Text = "connection is opend";
mycommand.Parameters.AddWithValue("rdate", TextBox5.Text);
mycommand.Parameters.AddWithValue("sno", TextBox1.Text);
mycommand.Parameters.AddWithValue("acno", TextBox2.Text);
mycommand.Parameters.AddWithValue("name", TextBox6.Text);
mycommand.Parameters.AddWithValue("vno", TextBox3.Text);
mycommand.Parameters.AddWithValue("amt", TextBox7.Text);
mycommand.Parameters.AddWithValue("chno", TextBox4.Text);
mycommand.Parameters.AddWithValue("edate", TextBox8.Text);
mycommand.ExecuteNonQuery();
connect.Close();
}