Stored Procedure using ASP.Net
I am creating an insert form which basically has three fields(name,password and department). I have created a stored procedure for insertion. I have also created a .cs file which handles all my connection settings including connection object ,command object. Now the problem is how to pass the values in th textbox to the class file.
Niradhip ChakrabortyPosted Apr 17, 2009, 8:11 AM
That you should tell me Vijaya........
You are welcome Randheer Singh
randheer singhPosted Apr 16, 2009, 10:29 PM
Vijaya KadiyalaPosted Apr 16, 2009, 1:56 PM
20Miles/hour is ok ;)
Niradhip ChakrabortyPosted Apr 16, 2009, 12:42 AM
Hahaha, I will slow down Vijaya.:-)
Vijaya KadiyalaPosted Apr 15, 2009, 11:06 AM
Niradhip, you are very fast..not giving any chance to post answers :)
Thanks -- Vijaya Kadiyala
www.DotNetVJ.com
Niradhip ChakrabortyPosted Apr 15, 2009, 1:06 AM
For sql injection you can refer the following URL:
1.http://forums.asp.net/t/1362351.aspx
2.http://dotnet.dzone.com/news/aspnet-preventing-sql-injectio
Vijaya KadiyalaPosted Apr 14, 2009, 2:04 PM
Hi
When you are implementing like this keep in mind about "SQL Injection" attack.
Thanks -- Vijaya Kadiyala
www.DotNetVJ.com
Niradhip ChakrabortyPosted Apr 10, 2009, 1:00 PM
Say your store procedure will accept two input parameter.
and you want to pass textbox value to store procedure.Please check the following code
my store procedure name is SPR_GetBoothdetails
SqlCommand sqlComm;
string strConnectionString = ConfigurationManager.AppSettings["ConnectionString"];
sqlConn = new SqlConnection(strConnectionString);
string strvalu1 =txtValu1.Text;
string strvalu2 =txtValu2.Text;
sqlComm = new SqlCommand("SPR_GetBoothdetails", sqlConn);
sqlComm.CommandType = CommandType.StoredProcedure;
sqlComm.Parameters.Add(new SqlParameter("@str_valu1",strvalu1));
sqlComm.Parameters.Add(new SqlParameter("@str_valu2", strvalu2));
Vijaya KadiyalaPosted Apr 10, 2009, 12:46 PM
Check out the below link
http://www.macronimous.com/resources/calling_stored_procedures_from_ASP.NET_and_VB.NET.asp
Thanks -- Vijaya Kadiyala
www.DotNetVJ.com