G
Guest
Hi All,
I was wondering if any one knew how to create INSERT statement using the OleDbDataCommand, that includes single quotes in the data that is entered in the table fields.
e.g.
string fieldval = "Some Data with single's quotations";
OledbCommand cmd = new OledbCommand("INSERT INTO Table (SomeStringField) VALUES ('"+ fieldval +"')", OleDbConnection);
Now as indicated in the above statement the fieldval single quotation causes the OleDbCommand to throw an error.
Whats the way around to INSERT data into a string Field, when the data itself has single quotes embedded in it.
With Regards
Thanks
I was wondering if any one knew how to create INSERT statement using the OleDbDataCommand, that includes single quotes in the data that is entered in the table fields.
e.g.
string fieldval = "Some Data with single's quotations";
OledbCommand cmd = new OledbCommand("INSERT INTO Table (SomeStringField) VALUES ('"+ fieldval +"')", OleDbConnection);
Now as indicated in the above statement the fieldval single quotation causes the OleDbCommand to throw an error.
Whats the way around to INSERT data into a string Field, when the data itself has single quotes embedded in it.
With Regards
Thanks