Monday 2 January 2012

Connection in vb.net with dsn


Create a connection with vb.net to SQL server through dsn,

"Try
                Dim strsql As String
                strsql = "Provider=MSDASQL.1;DSN=dsnTest;UID=sa;"
                conDb.ConnectionString = strsql
                conDb.Open()
Catch exConnection As Exception
                MsgBox(exConnection.Message)
End Try"