title: AddWithValue to SQL Statements? VB.Net
body: <p>I have a bunch of AddWithValue statements. I have been racking my brain to figure out a way to change them into SQL Statements.</p>
  
  <p>This is what it currently looks like;</p>
  
  <pre><code>Dim updateStatement As String =
          "UPDATE Customers SET " &amp;
          "Name = @NewName, "
          "WHERE Name = @OldName "
  
      Dim updateCommand As New OleDbCommand(updateStatement, connection)
      updateCommand.Parameters.AddWithValue("@NewName", newCustomer.Name)
      updateCommand.Parameters.AddWithValue("@OldName", oldCustomer.Name)
  </code></pre>
  
  <p><strong>'Connection Open blah blah blah Connection Closed.</strong></p>
  
  <p>I was told a different way of doing it was;</p>
  
  <pre><code>Dim SQL as String = "UPDATE Customers SET" &amp;
  "Name = '" Customer.Name "', "
  </code></pre>
  
  <p>But it refuses to work this way saying that just the two first double quotations is it.</p>
  
  <p>"Name = '" <em>Customer.Name "',"</em> In italics the code is black and not red which refuses to work.</p>
  
  <p>I am not using a database, I am simply pulling it from the file itself (As if it were in Access)</p>
  
  <p>Help me with whatever you can! I wish I could just leave it because if it's not broken don't fix it. But my teacher has a funny way of messing with people.</p>