I'm pretty much a newbie when it comes to stored procedures and ASP.NET, but I'm wanting to convert all of my recordsets to stored procedures throughout my site. I'm running into trouble with what should be a simple stored procedure.
This is what I classically would have done using a recordset:
Code:
<%
Response.Buffer = True
'Declare form variables
Dim strUsername As Object = trim(Request.Form("txtUsername"))
Dim strPassword As Object = trim(Request.Form("txtPassword"))
'Recordset
Dim objConn As Object, rsAccounts As Object
objConn = Server.CreateObject("ADODB.Connection")
objConn.Open (strConnAccounts)
rsAccounts = "SELECT * FROM tblAccounts WHERE Username = '" & strUsername & "' AND Password = '" & strPassword & "'"
rsAccounts = objConn.Execute(rsAccounts)
objConn.Close
rsAccounts = nothing
objConn = nothing
'Test output
Response.Write("FName: " & rsAccounts("FName") & "<br />")
Response.Write("LName: " & rsAccounts("LName") & "<br />")
%>
How can I accomplish this with using a Stored Procedure? I don't understand how I can use variables within an ASP.NET page within a Stored Procedure's WHERE clause. Thanks for any help.
KWilliams