How do I call a stored procedure in vb2005
call the database MYdatabase
call the Stored procedure MYStoredproc.
Any help?
Dave
PS: it dosen't require and values passed to it, its very simple.
Maybe this snippet can help:
Dim MyCmd As New OleDbCommand()Dim Cnxn As New OleDbConnection("ConnectionString")With MyCmd.
Connection = Cnxn.
CommandType = Data.CommandType.StoredProcedure.
CommandText = "MyStoredproc"End WithCnxn.Open()Dim MyReader As OleDbDataReader = MyCmd.ExecuteReaderWhile MyReader.ReadDim Column0Data As String = CStr(MyReader(0))End WhileCnxn.Close()command.Parameters.Add(New SqlParameter(@au_id, authorId))
(command is the SqlCommand created earlier).
I just cant figure out why they are doing this? Is it something you have to do while calling a stored procedure?
Excuse me for possible bad English/American.