Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Contributor
3068 Points
1378 Posts
Feb 06, 2012 04:32 PM|LINK
I am trying to create and INSERT statement with and OLE adapter. I had it working without paramters, but now I am trying to add parms and am having issues with the syntax. Ha
Here is the code so far...
command = New OleDbCommand(sql, pConn) sql = "INSERT INTO Strings (String_Name, Long_Text, Short_Text, Alternate_Text, Multi_String_ID, Lang_ID) VALUES (?,?, """ & ptsShortText & """)" command.Parameters.Add("@webStringName", OleDbType.VarChar, 250, "String_Name") command.Parameters.Add("@webLang_String", OleDbType.VarChar, 250, "Long_Text") command = New OleDbCommand(sql, pConn) command.ExecuteNonQuery()
Was just trying to get the first two variables parameterized.
Any suggestions would be greatly appreciated.
march11
Contributor
3068 Points
1378 Posts
insert command OLE parameterized
Feb 06, 2012 04:32 PM|LINK
I am trying to create and INSERT statement with and OLE adapter. I had it working without paramters, but now I am trying to add parms and am having issues with the syntax. Ha
Here is the code so far...
command = New OleDbCommand(sql, pConn)
sql = "INSERT INTO Strings (String_Name, Long_Text, Short_Text, Alternate_Text, Multi_String_ID, Lang_ID) VALUES (?,?, """ & ptsShortText & """)"
command.Parameters.Add("@webStringName", OleDbType.VarChar, 250, "String_Name")
command.Parameters.Add("@webLang_String", OleDbType.VarChar, 250, "Long_Text")
command = New OleDbCommand(sql, pConn)
command.ExecuteNonQuery()
Was just trying to get the first two variables parameterized.
Any suggestions would be greatly appreciated.