MySQL Connector/NET 5.2 main features
- A new profile provider has been implemented along with a fully revamped provider schema.
- New bulk loading and script execution classes are available.
- The ability to clear a single or all connection pools.
- Integration into Visual Studio 2008
- MySqlDataAdapter now supports batching
- BINARY(16) columns are now treated as GUIDs
- Various changes in how we handle parameters.
How to use the MySQL Connector/NET
In order to use this component you have to add a reference to the MySql.Data.dll (from the MySQL Connector/NET package you downloaded form MySQL web site).C# .NET
using MySql.Data.MySqlClient;
...
string connString = "SERVER=localhost;" +
"DATABASE=mySQLDatabase;" +
"UID=user;" +
"PASSWORD=password;";
MySqlConnection conn = new MySqlConnection(connString);
MySqlCommand command = conn.CreateCommand();
MySqlDataReader reader;
command.CommandText = "select * from table";
conn.Open();
reader = command.ExecuteReader();
while (reader.Read())
{
// Read the value...
string value = reader.GetValue(0).ToString();
}
conn.Close();
Here you can read more about how to use command parameters with MySQL and C#: The ADO.NET command parameters
1 comment:
Hi,
Publish your blog content URL at www.dotneturl.com and get .NET reader from us.
Post a Comment