{
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...

Ryan AlfordRank #1,411 · 1.2K reputationPosted May 13, 2008, 10:31 AM EDT
Dipal ChoksiRank #199 · 12K reputationPosted May 13, 2008, 7:45 PM EDT
(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.
jeevan mummadi140 reputationPosted May 13, 2008, 7:59 PM EDT