I want populate a datagrid with a dbase mysql but i have an error with sqldataadapter. This connection with insert and select in combobox its ok but i dont use sqldataadapter, its only for datagrid.
An unhandled exception of type System.ArgumentException occurred in system.data.dll
Additional information: Unknown connection option in connection string: driver.
An unhandled exception of type System.ArgumentException occurred in system.data.dll
Additional information: Unknown connection option in connection string: driver.
Code:
Dim sConn As String = "Driver=MySQL ODBC 3.51 Driver; Database=dbase;dsn=dsn;uid=;password=;"
Dim SQL As String = "SELECT * FROM vari"
Dim objConn As New OdbcConnection(sConn)
Dim objCommand As New OdbcCommand(SQL, objConn)
Dim objdataadapter As New OdbcDataAdapter(SQL, objConn)
Try
objConn.Open()
Catch excep As System.Exception
Windows.Forms.MessageBox.Show(excep.Message)
End Try
Dim dataAd As New SqlDataAdapter(SQL, sConn)
[-vb]