I have a bunch of AddWithValue statements. I have been racking my brain to figure out a way to change them into SQL Statements.
This is what it currently looks like;
Dim updateStatement As String =
"UPDATE Customers SET " &
"Name = @NewName, "
"WHERE Name = @OldName "
Dim updateCommand As New OleDbCommand(updateStatement, connection)
updateCommand.Parameters.AddWithValue("@NewName", newCustomer.Name)
updateCommand.Parameters.AddWithValue("@OldName", oldCustomer.Name)
'Connection Open blah blah blah Connection Closed.
I was told a different way of doing it was;
Dim SQL as String = "UPDATE Customers SET" &
"Name = '" Customer.Name "', "
But it refuses to work this way saying that just the two first double quotations is it.
"Name = '" Customer.Name "'," In italics the code is black and not red which refuses to work.
I am not using a database, I am simply pulling it from the file itself (As if it were in Access)
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.