I could not get the text in strConnString into Conn. The parts in bold are what I believe the problem lies. Can someone please help me out? I am trying to connect to SQL Server, ODBC.
VB.NET:
Public Sub functionshow(ByVal nric1 As String)
Dim myform As New Form2
Dim myServer As String = "AES-HP05"
Dim myid As String = "userid"
Dim mypassword As String = "userpassword"
Dim myDatabase As String = "AH_HFL"
Dim strConnString As String
Dim participantNRIC As String
Dim Conn As New SqlConnection
Dim n As Integer
Try
strConnString = "userid=" & myid & ";password=" & mypassword & ";Database=" & myDatabase & "; Server=" & myServer & ";"
Conn.ConnectionString = strConnString
Conn.Open()
Catch ex As Exception
MsgBox("Put some sort of error trapping message in here")
End Try
' Conn.ConnectionString = "///"
If Conn.State = ConnectionState.Closed Then
Conn.Open()
End If
Last edited: