Reputation: 958
there are many answers out there regarding adding mysql to visual studio to make it available as a data source. i have successfully added mysql for visual studio to my installation and in the server explorer, i can add a mysql data connection. works just fine.
i have looked at the configuration for the mysql data connection, and it looks fine. the data source is set to 'mysql database' and the data provider is set to '.net framework data provider for mysql'.
however, there is still a problem. now that i have a mysql data connection in the server explorer (test connection works fine), mysql will not show up when i do the following:
(on a project)
add -> new item ->
visual c# -> ado.net entity data model ->
generate from database
at this point a dialog is presented to choose the data connection. the drop down shows a sqlserver data connection i have from another solution (buckyw7\buckyw7.OACE.dbo is a sqlserver connection). fine. however, the data connection that i just added and shows up fine in the solution explorer for mysql is not displayed.
when i go to the 'new connection' dialog, the mysql data connection is not available in the list:
does anyone have any suggestions as to what i must do to add an ado.net object connected to the mysql data source in the server explorer?
Upvotes: 3
Views: 763
Reputation: 2926
According to my knowledge, Just install the MySQL connector and add the reference. That's enough. Then call the dll and create the connection string and you can use normal way
Upvotes: 0
Reputation: 361
This is funny bug because Microsoft blame MySQL this is their bug. And MySQL blame Microsoft they have to add MySQL namespace. Then both don't fix this. Basically don't use MySQL connection in that way. but you can connect in this way:
Dim myConnection As New MySqlConnection
Dim connectstring AS String = 'myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;'
Dim myCommand As New MySqlCommand('SELECT * FROM Table', myConnection)
myConnection.ConnectionString = myConnectString
myConnection.Open()
Dim myReader As MySqlDataReader=MyCommand.ExecuteReader()
Upvotes: 3