hi to all
i am sridhar
i need a simple example for all type of function in stored procedure
thanxs
i am sridhar
i need a simple example for all type of function in stored procedure
thanxs
Public Function FooBar(ByRef newUserID as String, ByRef newUserPswHash) As Boolean
Dim sqlcom As New SqlCommand
Dim res As Boolean = False
sqlcom.CommandType = CommandType.StoredProcedure
'Indicating which store procedure to use by supplying the sqlcom.CommandText with the store procedure's name
sqlcom.CommandText = "add_user"
'Adding the parameters the store procedure is expecting
sqlcom.Parameters.Add("@u_id", SqlDbType.VarChar, 15).Value = newUserID
sqlcom.Parameters.Add("@u_passwordHash", SqlDbType.VarChar, 40).Value = newUserPswHash
'Setting the sqlcom.Connection to a pre-defined connection
sqlcom.Connection = Connection
Try
res = (sqlcom.ExecuteNonQuery()=1)
Catch ex As Exception
res = False
End Try
Return res
End Function
Comment