Last post Jul 20, 2008 08:15 PM by johram
Jul 20, 2008 07:02 PM|Zahyea|LINK
I got values from other pages. but i can not save it in database as my insert code is wrong. .
Please can you see my code.
rsult = Request.Params.Get(
Please can you check my insert code as i got values from other pages.
Jul 20, 2008 08:15 PM|johram|LINK
To begin with, you have to make sure that you actually get some values from the Request.Params collection. If I were you, I would put a breakpoint on the pid statement and then step through the statements and see what values you get.
Once you have verified that the correct values are retrieved from Request.Params you need to have a look at your SQL code.
The strsql line alone won't do an insert, something I hope you are aware of. You need SqlConnection/SqlCommand to actually perform the insert.
Also, I would advise you to take a look at SqlParameters instead of concatenating the values into the INSERT string. SqlParameters will protect you from SQL Injections, and in general make your life a lot easier.