Tuesday, October 7, 2008

Connect .NET with MySQL

To connect .NET with MySQL u will have to follow following steps
  1. install mysql-connector-net-5.2.3 from net (its free)
  2. Import mysql.data which u will get in installation folder of above software
  3. import namespace = imports MySql.Data.MySqlClient
  4. then use mysqladaper,mysqlcommand,mysqlconnection as u use oledbdataatapter,oledbcommand,OleDbConnection
  5. when ever u will try to exis table which contain date in 00:00:0000 format then u will get exception like 'unable to convet mysqldatetime type to system datetime type' so to overcome this type of problem either make that datatime field in table as allow null or write the following in connection string "Allow Zero Datetime=true"

Share This!

No comments:

Powered By Blogger · Designed By Seo Blogger Templates