Tuesday, March 20, 2012

Problem whith insert into SQL server from webservice

My webservice is suppoed to insert a row into my SQL server database. Al columns are varchar(String). When we insert with digits everything is ok, but when we try letters as parameters i get this error message:

"An unhandled exception of type 'System.Web.Services.Protocols.SoapException' occurred in system.web.services.dll

Additional information: Server was unable to process request. --> The name 'Bob' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted."

Any idea?Show the code that is creating the INSERT statement. Presuming Bob is a string you are trying to insert, are you either using parameters (best solution) or alternately, enclosing the variable in quotes in the resulting string.|||I solved the problems by using parameters instead. Thank you! :)|||Glad to hear it. Parameters eliminate all sorts of problems, in addition to making your application much more secure.

No comments:

Post a Comment