vb.net 2005 Connecting to MySQL 5 [modified]
-
Hi guys, I am writing a system that should connect to varied database systems (currently MS SQL 2000, 2005 and MySQL). I decided to use Oledb.net provider for my connections. For the different versions of MSSQL it works fine but I am having a problem trying to run commands on MySQL connection. I got the following connection string from the net
Dim myCommand As New OleDbConnection("Provider=MySqlProv.3.0;Data Source=th911;User Id=root;password=root")
From my analysis of the connection string there is no database name (Initial Catalog). How then does MySQL know the database i am interested in or how can i make it known without having to enter the credentials every time i open the connection? Thanks for your assistance guys.:(( -Mbire- I can resist everything else except temptation... -- modified at 8:24 Monday 10th September, 2007 -
Hi guys, I am writing a system that should connect to varied database systems (currently MS SQL 2000, 2005 and MySQL). I decided to use Oledb.net provider for my connections. For the different versions of MSSQL it works fine but I am having a problem trying to run commands on MySQL connection. I got the following connection string from the net
Dim myCommand As New OleDbConnection("Provider=MySqlProv.3.0;Data Source=th911;User Id=root;password=root")
From my analysis of the connection string there is no database name (Initial Catalog). How then does MySQL know the database i am interested in or how can i make it known without having to enter the credentials every time i open the connection? Thanks for your assistance guys.:(( -Mbire- I can resist everything else except temptation... -- modified at 8:24 Monday 10th September, 2007Mbire wrote:
How then does MySQL know the database i am interested in or how can i make it known without having to enter the credentials every time i open the connection?
You will need to specify the database name. http://www.connectionstrings.com[^] has many different database connection strings that you might find helpful.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon