Re: VB.NET MySQL Connection String
Posted by:
Scott Lane
Date: January 16, 2005 09:50AM
pairash plearnmalai wrote:
> 1. Add Reference
> 2. Browse
> 3. Select File 'MySql.Data.dll'
> at
> C:\Program Files\MySQL\MySQL Connector Net
> 1.0.3\bin\.NET 1.1
> 4. You put code
> Imports MySql.Data.MySqlClient
And the connection string may look something like this (it has worked in my .NET code):
conn.ConnectionString = "User ID=" + _authInfo.UserName + ";" +
"Password=" + _authInfo.UserPassword + ";" +
"Host=localhost;" +
"Port=3306;";
This connection does not use a database, but you can extend the connection string with "database=xxx;"
A piece of me wishes that Connection objects had a consistent connection string semantic. It is annoying that and OdbcConnection requires UID whereas an ADO.NET connection requires "User ID", and other such differences. It would also be nice if the .NET connector providers would document the connection string arguments like they did for the ODBC connector.
I have been using the OdbcConnector, but in the case where I want my tool to create a database, I needed to use a direct connection. Depending on how well this connector works (compared to the more tried and true ODBC connector) I may start switching over other code.
Subject
Written By
Posted
November 08, 2004 08:17PM
November 09, 2004 11:21AM
Re: VB.NET MySQL Connection String
January 16, 2005 09:50AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.