Run Stored Procedure from VB

  • Hi -

    I was wondering if anyone has a simple example of how you can run a stored procedure from VB? I am new to both VB and sql server.......I am hoping it is possible.

    Thank you!

    Allen

  • You ave to create SQLConnection object, then SQL Command, configure the SQLCommand object and eventually execute it. There are several methods of execution, varying with the returned results. Please read the MSDN article in the link.

    SQLCommand has CommandType property that specifies whether the query you provided is a stored procedure or ad hoc SQL command. By default it is text, so to call stored procedure you have to change it to StoredProcedure.

    Personally I think that if you never had exposure to .NET programming, it would be better if you learned C# though than VB. C# seems to be more mainstream.

    Regards

    Piotr

    ...and your only reply is slàinte mhath

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply