i saw this problem when i connect my visual studio 2010 and ms server 2008
string connstring = "server=Data Source=KSADULAN-PC\\SQLEXPRESS;Initial Catalog=Hanumantha;Integrated Security=True";
Cone = new SqlConnection(connstring);
Cone.Open();----------------------(here problem start)
Come=new SqlCommand("insert into cheque values("+chno.Text+","+amo.Text+","+Date.Text+","+Towhom.Text+","+Purpo.Text+"')",Cone);
try
{
Come.ExecuteNonQuery();
MessageBox.Show("Saved............");
}
catch (Exception)
{
MessageBox.Show("not saved......");
}
finally
{
Cone.Close();
}
this is my code please consider it.now i am waiting to your answer

Ravi ShekharPosted Apr 23, 2013, 4:30 AM
Your connection string is wrong.Replace your connectionstring.
Replace..
string connstring = "server=Data Source=KSADULAN-PC\\SQLEXPRESS;Initial Catalog=Hanumantha;Integrated Security=True";
With..
string connString = "Data Source=KSADULAN-PC\\SQLEXPRESS; Initial Catalog=Hanumantha; Integrated Security=True";
Regards,
Ravi