RAISERROR on my ASP.NET Web Application
I have a Store Procedure called LogIn. On my ASP.NET web application I'm using the following codes to run this store procedure.
Dim VarifyPassword As String
'Clear the Text in the Label before you get a value.
Me.lblError.Text = ""
MyDataAdapter.SelectCommand = New SqlCommand
MyDataAdapter.SelectCommand.Connection = MyConnection
MyDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure
MyDataAdapter.SelectCommand.CommandText = "LogIn"
MyDataAdapter.SelectCommand.Parameters.Add(New SqlClient.SqlParameter("@UserID", Me.txtUserID.Text))
MyConnection.Open()
VarifyPassword = MyDataAdapter.SelectCommand.ExecuteScalar()
MyConnection.Close()
Me.lblError.Text = VarifyPassword
My this my Store Procedure.
CREATE Procedure LogIn @UserID VarChar(10)
As
Declare @MyData VarChar(10)
Select @MyData = Status From UserInfo WHERE UserID = @UserID
If @MyData ='1'
Begin
Raiserror (50001,10,1)end
Else
Raiserror (50002,10,1)
Now what I would like to do run this store procedure on my web application and have the RAISERROR display on a Label locate on my web application. Is this possible???
Thanks
Sincerely; Oscar Martinez
__________________
Thanks
Sincerely; Oscar Martinez
|