Looking for Visual Basic .Net demo code using SQL client .net provider

  • Have never programmed a visual basic .net application that uses the SQL client provider.  Would be most grateful if demo code or applications could be e-mailed me.

    TIA

    Gary Andrews

    garywandrews@cox.net

     

  • Dim MyConn As SqlConnection = "YOUR SQL CONNECTION"

    Dim mySqlCommand As SqlCommand = New SqlCommand("ListPublication", MyConn)

                If MyConn.State <> ConnectionState.Open Then

                    MyConn.Open()

                End If

                mySqlCommand.CommandType = CommandType.StoredProcedure

                SqlCommandBuilder.DeriveParameters(mySqlCommand)

                mySqlCommand.Parameters(1).Value = PublicationID

                Dim dsPublication As New DataSet

                Dim NewDataAdapter As New Data.SqlClient.SqlDataAdapter(mySqlCommand)

                Try

                    NewDataAdapter.Fill(dsPublication, "Images")

                Catch ex As Exception

                    MsgBox(ex.Message)

                End Try

                MyConn.Close()

  • Thanks

    Gary

  • Have a look at http://www.pscode.com

     

Viewing 4 posts - 1 through 3 (of 3 total)

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