Posted on: 10/4/2013 4:42:15 AM | Views : 277

Hi All,
I have a scenario where I am checking whether a user is existing or not. If the user exists, then I am returning the custID from stored proecdure. if user does not exists I am returning count of total users. 
When I get custID I ll proceed to next level. If I get Count I need to generate a new CustID.
I have used IF Exists() ..ELSE in my stored procedure. In codebehind how can i check whether custID is returned or a count is returned from stored procedure, since ill be getting a row from datareader. 
BEGIN --Check if the user is already present IF EXISTS(SELECT 1 FROM tblLogin lgn WHERE lgn.tblLogin_CustomerEmail = @chvCustEmail) SELECT CustID as CustomerID FROM Table WHERE custEmail = @CustEmail ELSE SELECT COUNT(CustID) TotalCount FROM Table END Any help appreciated.

Go to the complete details ...