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;          
reason i'm timing out on ( mycommand6.executenonquery();)

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

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

BizTalk Server 2013 Azure VM Log Shipping and HA for hosts

How to Share webservice object to all user