c# - no row at position zero after loop -


Text after "

I need help with the following:

  foreach (dt.rows in DataRow Dr.) {Preparation Document (Dr.); } // Try updating table table entries {string constring = "........"; String query = @ "updated processed set OnSiteWorkTx = 1 where VisitNumber = @company and processed = 0"; (Using SqlConnection conDatabase = new SqlConnection (constring)) (SqlCommand cmdDatabase = New SqlCommand (query, conDatabase)) {cmdDatabase.Parameters.AddWithValue ("@ Company", MyVariable); ConDatabase.Open (); CmdDatabase.ExecuteNonQuery (); }} Hold (Exception preceded by) {Response.Write (ex.Message); }  

inside PrepareDocument I have the following:

  Private Zero PrepareDocument (DataRow Dr.) {string connectWrk = ".. ......... "; Using (SqlConnection connWrk = New SqlConnection (connectWrk)) {string queryWrk = '+ MyVarible + "" OnSiteWorkTx where VisitNumber = Select Workdone' '; SqlCommand cmdWrk = New SqlCommand (queryWrk, connWrk); Var ds = new dataset (); Var da = new SqlDataAdapter (cmdWrk); Da.Fill (DS); Var WorkDonon = Databables [0]. Roof [0] ["Workdon"]; Try {connWrk.Open (); TableWrk.AddCell (cellWrk); TableWrk.AddCell (Workdone.ToString ()); } Hold (ex before) {Response.Write (ex.Message); }}}  

To change table entries in the processed state, the code is going to be written before ready document (Dr.) , then the processed process can not get the entry It is now true and the error returns zero poster at zero.

Try the following:

  if (ds.Tables.Count & Gt; 0 & amp; amp; amp; amp; ds.Tables.Rows.Count> 0) {var Workdone = ds.Tables [0] .Rows [0] [0]; ...  

Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -