title: SQL UPDATE Query is failing silently, I suspect an enemy doublequote
body: <p>I have an ASP.NET application with C# behind. The application gets data from WebServices and then it should execute the below update.</p>
  
  <pre><code>sqlQueryString2 = "
  UPDATE CI
  SET
   platform =@platform ,
   wstart = @wstart,
   wend = @wend,
   model = @model,
   productDescription = @productDescription,
   scanflag = @scanflag     
  WHERE  serial = @serial ";
  </code></pre>
  
  <p>I realized that my application seems to be looping when certain values are returned from the Web service. The UPDATE is sent, doesn't commit, and then it is picked up again on the next loop as needing to be updated.</p>
  
  <p>I did a trace in SQL(Server 2005) and this is what is hitting the server:</p>
  
  <pre><code>exec sp_executesql N'
  UPDATE CI 
  SET 
   platform =@platform ,
   wstart = @wstart,
   wend = @wend,
   model = @model,
   productDescription = @productDescription,
   scanflag = @scanflag 
  WHERE
   serial = @serial ',N'
   @serial nvarchar(11),
   @platform nvarchar(23),
   @wstart varchar(10),
   @wend nvarchar(10),
   @model nvarchar(24),
   @productDescription nvarchar(35),
   @scanflag nvarchar(1)',
   @serial=N'H01170RAHS6',
   @platform=N'Client Computer - Apple',
   @wstart=N'05/09/2011',
   @wend=N'05/09/2012',
   @model=N'iMac (20-inch, Mid 2009)',
   @productDescription=N'IMAC 20"/2.26/2X1GB/160GB/SD/MSE/KB',
   @scanflag=N'Y'
  </code></pre>
  
  <p>I suspect that the single doublequote in the productDescription might be throwing it, but I have had a bugger of a time trying to strip it out or replace it with (in.).
  I think part of my issue on that front is the value stored when it is populated by the WebServices server is escaped as I can see it as "IMAC 20\"/2.26/2X1GB/160GB/SD/MSE/KB" in the watch list.
   I have tried replacing the escaped and non escaped quote with String.Replace as well as a RegEx statement. 
  TBH I'm not even sure I'm on the right track with the quote. I'm only looking at it because not all returns contain one and they don't all loop.</p>