SSH - connection problem
Posted: Fri 27 Jan 2006 19:19
Hi I'm trying to connect to MySql with the SSH-protocol. I'm using the code below, but I get an error at then line: conDBAccess.SshOptions.User = "tunnel"
The error says: Object reference not set to an instance of an object.
What is wrong. I've done exactly like shown in the Documentation.
Shared Function BuildConnStr() As String
Dim strConn As String = "host=localhost;protocol=SSH;user=jisdb;password=password;Database=iis"
Return strConn
End Function
'MySql
Public Shared Function objdbConnect() As MySqlConnection
Dim conDBAccess As MySqlConnection = New MySqlConnection(BuildConnStr())
conDBAccess.SshOptions.User = "tunnel"
conDBAccess.SshOptions.Password = "password"
conDBAccess.SshOptions.Host = "192.168.100.193"
Return conDBAccess
End Function
The error says: Object reference not set to an instance of an object.
What is wrong. I've done exactly like shown in the Documentation.
Shared Function BuildConnStr() As String
Dim strConn As String = "host=localhost;protocol=SSH;user=jisdb;password=password;Database=iis"
Return strConn
End Function
'MySql
Public Shared Function objdbConnect() As MySqlConnection
Dim conDBAccess As MySqlConnection = New MySqlConnection(BuildConnStr())
conDBAccess.SshOptions.User = "tunnel"
conDBAccess.SshOptions.Password = "password"
conDBAccess.SshOptions.Host = "192.168.100.193"
Return conDBAccess
End Function