BitDaddys

BitDaddys
Home

Product Sections
Product Locator
Email Utilities
Database Utilities
Other Products

Reference Sections
Articles
MySQL
Outlook - Import EML
.net Network Security
Flash
Fireworks
PHP
DB/C
Java
Email File Extensions
EML email file extension
MSG email file extension
TNEF email file extension
TXT email file extension
HTML email file extension
Java Script

OISV - Organization of Independant Software Vendors - Charter Member

Recommended Links

Get Firefox



Get Thunderbird  

MySQL

Find good sites at
Find good sites at Gimpsy  

 

Web Master:

Keith Birchfield


How to connect to MySQL 5.0. via C# .Net and the MySql Connector/Net


This article and tutorial describes and demonstrates how you can connect to MySQL in a c# application.

  • First, you need to install the mysql connector/net, it is located at: http://dev.mysql.com/downloads/connector/net/1.0.html
  • Next create a new project
  • Next add reference to: MySql.Data
  • Next add "using MySql.Data.MySqlClient;"
  • Finally add the following code to your application:
private void button1_Click(object sender, System.EventArgs e)
{
string MyConString = "SERVER=localhost;" +
"DATABASE=mydatabase;" +
"UID=testuser;" +
"PASSWORD=testpassword;";
MySqlConnection connection = new MySqlConnection(MyConString);
MySqlCommand command = connection.CreateCommand();
MySqlDataReader Reader;
command.CommandText = "select * from mycustomers";
connection.Open();
Reader = command.ExecuteReader();
while (Reader.Read())
{
string thisrow = "";
for (int i= 0;i<Reader.FieldCount;i++)
thisrow+=Reader.GetValue(i).ToString() + ",";
listBox1.Items.Add(thisrow);
}
connection.Close();
}

 


 

 

 
OISV - Organization of Independant Software Vendors - Charter Member
Highlighted Products
MSGDETACH
MSGDETACH
BitDaddys Corp.
$14.00

More Info
Free Trial
Buy Now!
Detach Email Attachments from your Email and Save them wherever you want! Extract your message attachments from Outlook msg files. more ...

emlBridge
BitDaddys Corp.
$12.00

More Info
Free Trial
Buy Now!
Import eml Files into nearly any Email Client. With emlBridge you can import rfc822 standard text email files into programs like Outlook, Thunderbird and Outlook Express more ...

emltohtml
BitDaddys Corp.
$14.00

More Info
Free Trial
Buy Now!
Convert eml Email Files into HTML Web Pages and more ...

O2X
ODBC 2 C#
BitDaddys Corp.
$5.00

More Info
Free Trial
Buy Now!
Convert ODBC table information into a c# class and a ready to use Visual Studio 2003 project more ...

outlookSpiller
EML and MSG Exporter

BitDaddys Corp.
$14.00

More Info
Free Trial
Buy Now!
Export eml, msg, tnef, txt and HTML Files from Outlook more ...

ThunderStor
ThunderStor
BitDaddys Corp.
$10

More Info
Free Trial
Buy Now!
ThunderStor offers the user a simple, fast and effective method to extract ThunderBird Mail from the mail box files to individual standard email message files.

MSGDETACH
mboxPack
BitDaddys Corp.
$10.00

More Info
Free Trial
Buy Now!
Pack email files into mbox files. Plain text, individual eml,msg,txt files to Thunderstor compatable and ready to use mbox more ...

EML and MSG converter
BitDaddys Corp.
$14.00

More Info
Free Trial
Buy Now!
Convert eml and msg Files into EML, MSG,TXT, TNEF, HTML more ...


Google

About Us | Site Map | Privacy | Contact Us | ©2008 BitDaddys Corp.