Link to home
Start Free TrialLog in
Avatar of dhathsato
dhathsatoFlag for United States of America

asked on

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,
ASKER CERTIFIED SOLUTION
Avatar of pbocanegra
pbocanegra

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dhathsato

ASKER

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