DIGIT-ARC read-only archive · snapshot: July 23, 2026

asp.net database.cs help

4 posts · originally from https://geek.digit.in/community/threads/asp-net-database-cs-help.124920/

M
meghraj Original post #1
Mar 8, 2010 at 7:42 PM
I am trying to develop a class in asp.net where I want to put some common functions but I don't know how to add value in sql query using ....Parameter.AddWithValue("@r", txt.Text) please suggest me some example or some tutorial please help....
krishnandu.sarkar
Mar 8, 2010 at 10:56 PM
Didn't understood your question clearly. But as far I got it I think you want to add values in to an SQL Insert Query. You can do it by Parameters.Add("Value"). The first statement will add value to the first field and so on..

For more better reference refer MSDN.
M
meghraj #3
Mar 9, 2010 at 3:18 PM
I am actually trying to develop a function through which I can able to add the value in sql query.....but I am not able to figure out the way to implement that....

the only thing I know is that I have to use SqlParameterCollection object...
krishnandu.sarkar
Mar 9, 2010 at 6:15 PM
Ya got it. Take a look here *msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlparametercollection.addwithvalue.aspx