Newbie Data Question.

pmaster

New Member
Just looking for ideas on how I can do this. I have the a storedProcedure with the below sytax. Now, in my aspx page I want to do this. When the user enters their name and password in my web form, then they click the login button, I want to run the stored proc. Then, when I run it I want to do this. First, I want to check if the first Select (the one that checks the user table) is empty (then the user doesn't exist), if it is then I want to show an error on the web form, if not (the user does exist), then I want to get the results of the first select and put them into local variables the I want to get the results of the other 2 selects and use them. How can I do this? Should I use DataReader? DataSet? Please help and provide some code, or links to something similar to what I am doing. Thanks a bunch. <BR><BR>********* Begin Stored Proc UserLogin ********* <BR>Select [id], firstName, lastName, userName, [password], email <BR>From [User] <BR>Where Active = 1 <BR> And userName = @userName <BR><BR>If @@rowCount > 0 <BR>BEGIN <BR> Select uha.hospitalId, h.name <BR> From UserModule um <BR> Join [User] u On u.id = um.userId <BR> Where u.userName = @userName <BR><BR> Select uga.groupId <BR> From UserGroupAssoc uga <BR> Join [User] u On u.id = uga.userId <BR> Where u.userName = @userName <BR>END <BR>********* End Stored Proc UserLogin *********First of all, did you test your stored procedure in query analyzer, if you did, what is the result
 
Back
Top