G
Guest
This is my first time posting here and I'm also relatively new to the .NET
environment.
I am inserting a string into a Microsoft Access Database. I get an error
because of the string format. I've researched escape characters and
parameterized sql statements and am still unable to come up with an answer.
Please help, here is my block of code...
OdbcCommand myCommand = new OdbcCommand("INSERT INTO Listgroup (From) VALUES
(?)", odbcConnection1);
int cmdresults;
myCommand.Parameters.Add("", OdbcType.Text).Value=q;
odbcConnection1.Open();
cmdresults = myCommand.ExecuteNonQuery();
odbcConnection1.Close();
The string q is a variable that contains any number of questionable
characters. An example would be "From: \"(Boggie)"\
<[email protected]>"
Thank you for your help in solving this problem.
environment.
I am inserting a string into a Microsoft Access Database. I get an error
because of the string format. I've researched escape characters and
parameterized sql statements and am still unable to come up with an answer.
Please help, here is my block of code...
OdbcCommand myCommand = new OdbcCommand("INSERT INTO Listgroup (From) VALUES
(?)", odbcConnection1);
int cmdresults;
myCommand.Parameters.Add("", OdbcType.Text).Value=q;
odbcConnection1.Open();
cmdresults = myCommand.ExecuteNonQuery();
odbcConnection1.Close();
The string q is a variable that contains any number of questionable
characters. An example would be "From: \"(Boggie)"\
<[email protected]>"
Thank you for your help in solving this problem.