Create a connection at runtime. I think you may have to change the connection string.
You can also create a DSN through your application.
Check your connection at run time
Dim strCON As String = "<Connection String>"
Dim strQuery As String = "Select * from TBL"
Dim DA As SqlDataAdapter = Nothing
Dim DS As DataSet = Nothing
Try
Dim CON As New SqlConnection(strCON)
DA = New SqlDataAdapter(strQuery, CON)
DS = New DataSet
DA.Fill(DS, "TBL")
CON.Close()
Catch ex As Exception
MsgBox("Error")
Me.Close()
Return
End Try
DataGrid1.DataSource = DS.Tables("TBL")
|