{
SqlConnection con = new SqlConnection("server=localhost;initial catalog=online_application1;user id=sa;pwd="); //richTextBox1.AppendText(msg);rtrecvdata.Text = msg;
con.Open();
string st="insert into data(totaldata) values('" + rtrecvdata .Text + "') " ; SqlCommand cmd = new SqlCommand(st, con);cmd.ExecuteNonQuery();
con.Close();
}
for every one min data will come into this method,received data is saved in database.but problem is code is executed but data is not saved in database.
tell me the reason...
jeevan mummadiPosted May 13, 2008, 11:59 PM
Dipal ChoksiPosted May 13, 2008, 11:45 PM
(1) Use an Exception handling block and see if you are getting an exception returned from the db
(2) In debug mode, get the contents of the string containing the final SQL statement and run it on the db and see if it is working OK.
Ryan AlfordPosted May 13, 2008, 2:31 PM