views:

256

answers:

1

Hi guys, I am trying to connect to mysql database from a .NET compact framework using C#. Each time I run the program, I get a missingmanifestresourceexception just at the point of opening the connection. Can any one please tell me how to go about this, I've lost four days already.

P.S: I already added the reference Mysql.Data.CF.

my code is as below

        string MyConString ="SERVER=localhost;" + "DATABASE=kunle;" + "UID=root;" + "PASSWORD=olakay;"+ "pooling=false;";


        MySqlConnection connection = new MySqlConnection(MyConString);
        MySqlCommand command = connection.CreateCommand();
        MySqlDataReader Reader;
        command.CommandText = "select * from mycustomers";
        try
        {



            connection.Open(); //***this is the point where I get the error***


            MessageBox.Show("Connected successfully");

        }
        catch (MySqlException asd)
        {
            MessageBox.Show("" + asd.Message);
        }
        catch (MissingManifestResourceException ex)
        {
            MessageBox.Show("" + ex.Message);
        }
        Reader = command.ExecuteReader();
        while (Reader.Read())
        {
            //statement goes here;
        }
        connection.Close();

will be looking forward to an answer from anyone.

Olakay.

A: 

Put "pooling=false" in the connection string. It resolved my problem.

Which version of connector are you using. I have succeeded with 5.2.7

I have posted resolution for this on MySql forum http://forums.mysql.com/read.php?38,228101,276266#msg-276266

igors
It seems as if `pooling=false` is already in there.
Fredrik Mörk
no it is not, by default (if pooling=false is missing) connectors assumes that pooling=true
igors
I already addedpooling false.Yet it does not solve the problem Olakay
huh ... give me your mail to send you the library I am using with the appropriate connection string.On my device with WindowsCE 5.0 works fine.
igors
Also ... I hope that you have enabled Wi-Fi and have a valid connection to your network.
igors
my e-mail is [email protected] for your help.
np, I am sending you them now
igors
Thanks, Shall be waiting.
want to quickly ask u this. did you connect directly from visual studio or did you deploy it first on your device. And did you have virtual PC installed on your system. Do you think it would help the connection?
Just used what you sent to me. It's still giving the MissingManifestResourceException.Any more clue?
Huh, what version of CF are you using? Which version of MySql you're trying to connect?
igors

related questions