DataGridView and DSN connection

I have received a user defined connection string from a MSDASC datalink.  Now I need to have this connection string open the data in a data grid.  Could I please get some help on this, I am a little lost.  It is a windows form.  Thank you,
dhathsatoAsked:
Who is Participating?
 
dhathsatoAuthor Commented:
This is what I have so far.  Basically it brings the dialog box up for the customer to select or create their connection.  I reveiwed the link above and still a little confused on how I would go about implementing a DataGridView with the returned connection string.

    Private Sub DataSourceToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataSourceToolStripMenuItem.Click
        Dim mydlg As New MSDASC.DataLinks()
        Dim ADOcon As New ADODB.Connection()

        ADOcon = mydlg.PromptNew
        Try
            ADOcon.Open()
            If ADOcon.State = 1 Then
                'connection string returned from dialog box
                MsgBox(ADOcon.ConnectionString)
            Else
                MsgBox("Connection Failed")
            End If

        Catch ex As Exception

        End Try

    End Sub
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.