ExecuteNonQuery
i have simple update function. problem times out. i'm not sure why since in mgmt studio runs instantaneously.
have rather simple update function... bool breturn = false; datetime currentdate = datetime.now; sqlconnection dblogfile; string strcommand = ""; string connstring = properties.settings.default.cnnstring; dblogfile = new sqlconnection(connstring); dblogfile.open(); // strcommand = "update [rawfacnotes] set [lastexportdate] = '" + currentdate + "' dataid = " + iid; sqlcommand mycommand6 = new sqlcommand("update [rawfacnotes] set [lastexportdate] = '" + currentdate + "' dataid = " + iid, dblogfile); try { mycommand6.executenonquery(); dblogfile.close(); breturn = true; } catch (exception ex) { dblogfile.close(); console.writeline(ex.message.tostring()); breturn = false; } return breturn;
ideas great. i'm @ wits end.
matthew
are connecting management studio using same credentials application? check make sure user specified in connection string has permissions need update database.
what happens if hard-code date , id , try executing it?
check out my blog tech news, development tips, , other information geeks me.
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment