When i connect my database in VB.net i got an error format of the initialization string does not conform to specification starting at index 0.
My code is:
Dim conobj1 As MySqlConnection
conobj1 = New MySqlConnection("server" + txtdatabase.Text & "';'" & "userid" + txtUser.Text & "';'" & "password" + txtPass.Text & "';'" & "database" + txtData.Text)
conobj1.Open()
conobj1.Open()

Khan Abrar AhmedPosted Oct 28, 2014, 2:11 AM
Dim MysqlConn As MySqlConnection
MysqlConn = New MySqlConnection()
MysqlConn.ConnectionString = "server=" & txtServer.Text & ";" _
& "user id=" & txtUsername.Text & ";" _
& "password=" & txtPassword.Text & ";" _
& "database=test"
MysqlConn.Open()
MessageBox.Show("Connection to Database has been opened.")
MysqlConn.Close()
or refer this link
http://www.dreamincode.net/forums/topic/115753-use-vbnet-to-connect-to-mysql/
RiniPosted Oct 28, 2014, 2:35 AM