Click here to Skip to main content
15,922,574 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to save data in my service database after made service database what can I deploye window application.
please help me
I have made service database and creat the connection but value is not inserting
my connection and sql commond is---below
 private void button1_Click(object sender, EventArgs e)
    SqlConnection CON = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database1.mdf;Integrated Security=True;User Instance=True");
    SqlCommand cm = new SqlCommand("insert into table3 (name) values(@name)", CON);
    cm.Parameters.AddWithValue("@name", textBox1.Text);

above my commond exicute sucsessfull and there is no error but value not save in database table....what can I do
Updated 23-Sep-12 20:15pm
_Amy 24-Sep-12 2:19am    
There is two things which is confusing me:
1. ASP.NET C# Problem not inserting data in table.
2. I deploye window application.

Can you please tell me whether you are using windows or web application.

vishal shukla shukla 24-Sep-12 7:57am    
I m using window application form
fjdiewornncalwe 25-Sep-12 14:34pm    
Does this code work when you execute it on your development machine?
Does this code fail when you deploy the application to another machine?

check storeprocdure which is working properly...
Share this answer
can u give clear view like what type of error u get and code etc
Share this answer
vishal shukla shukla 24-Sep-12 7:59am    
No error but there is no value inserting

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900