Newbie Data Question.

Results 1 to 2 of 2

Thread: Newbie Data Question.

  1. #1
    Join Date
    Dec 1969

    Default Newbie Data Question.

    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&#039;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 &#062; 0 <BR>BEGIN <BR> Select uha.hospitalId, <BR> From UserModule um <BR> Join [User] u On = um.userId <BR> Where u.userName = @userName <BR><BR> Select uga.groupId <BR> From UserGroupAssoc uga <BR> Join [User] u On = uga.userId <BR> Where u.userName = @userName <BR>END <BR>********* End Stored Proc UserLogin *********

  2. #2
    Join Date
    Dec 1969

    Default RE: Newbie Data Question.

    First of all, did you test your stored procedure in query analyzer, if you did, what is the result

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts