Results 1 to 6 of 6

Thread: Execute Stored Procedure from VB

Threaded View

  1. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2005
    Posts
    259

    Re: Execute Stored Procedure from VB

    This is what if ended up with and it seems to work fine. However I am wondering if there is something that I can add that will tell me the procedure finished the task?
    Code:
            Dim cn As SqlConnection = New SqlConnection
            cn.ConnectionString = Con
            cn.Open()
            Dim cmd As SqlCommand = New SqlCommand("sp_InsertInv", cn)
            cmd.CommandType = CommandType.StoredProcedure
            Try
                cmd.ExecuteNonQuery()
            Catch ex As Exception
                MessageBox.Show(ex.Message & vbNewLine & _
                ex.Source, "Data Error", MessageBoxButtons.OK)
            End Try
    Last edited by FastEddie; Aug 1st, 2007 at 07:25 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width