日期:2014-05-17  浏览次数:20622 次

判断用户是否已注册的另一种方法
 Dim mycomm1 As SqlClient.SqlCommand
        mycomm1 = New SqlClient.SqlCommand(ab, myconn)
        mycomm1.CommandType = CommandType.StoredProcedure
        Dim num1 As SqlClient.SqlParameter = mycomm1.Parameters.Add("@工号", System.Data.SqlDbType.Char, 10)
        num1.Value = Textgonghao.Text
        Dim myreader As SqlClient.SqlDataReader
        Try
            myconn.Open()
        Catch ex As Exception
            myconn.Open()
        End Try
        Try
            myreader = mycomm1.ExecuteReader
            If myreader.HasRows = True Then
                MsgBox("用户已注册", , "提示")

请问我的“ab”的存储过程在SQL中要怎么样写才行?
存储 sql vb.net ado.net

------解决方案--------------------
create proc ab((@工号 char(10))
as
 select * from tb where 工号=@工号