C# - MySQL - Newbie - Going Crazy
Posted by: suny_moi
Date: November 20, 2006 02:41AM

GOD! Someone has to help me, i've been stuck with this problem for almost 4 hours now ( over night!) i'm going crazy!

So here it is. i'm completely new a this. This is my first database at all.
I Want to use MySql databases with my C# classes..
OK so up until now everything is fine eh. MySQL is installed and running through EasyPHP. (so it's MySQL 4.1.9-max )

I knew for a Fact that for connecting to MySQL using VS2005 on my winXP machine I Would need some connector. So I downloaded and installed MySQL Connector/Net or something close to this.

I went into my ODBC Settings to add a new DNS user using the SQL .net blabla drivers. a connection Test was succesful. GREAT!

Now Back to VS2005, I try a simple bit of code sample from the net to test my connection and I come to the point where I don't know what to put in my connectionString -> provider= parameter! Whatever I put in won't work. I have no idea of what to do now. After hours of browsing forums, googling, microsofting. well... I'm at a point where I need to post that stupid question lol.

System.Data.OleDb.OleDbConnection con;
con=new System.Data.OleDb.OleDbConnection("");
con.ConnectionString = "Provider=SQLProv;";
try
{
con.Open();
if (con.State==ConnectionState.Open) MessageBox.Show("Connection to MySQL opened through OLE DB Provider");
con.Close();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}

Please help me out!

PS : I'm able to use VS' "connect to Database" option and see my tables in the Server Explorer. But for the code to transpose something.. no idea!

Edit : I think i'll try to use the lib shared with the .net connector... could help to have it to work I guess



Edited 2 time(s). Last edit at 11/20/2006 11:01AM by suny_moi.

Options: ReplyQuote


Subject
Written By
Posted
C# - MySQL - Newbie - Going Crazy
November 20, 2006 02:41AM


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.