MySql ado.net connector problem

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

My host doesn't offer SqlServer, so I'm taking a swing at MySql and so far
I'm getting a FileNotFoundException in my asp.net app when I try to
instantiate a MySqlConnection object.
I have added a reference to the dll and including the namespace in my using
directive.

Here is the stack trace:
[FileNotFoundException: The system cannot find the file specified.]

[FileNotFoundException: File or assembly name 'MySql.Data,
Version=1.0.4.20163, Culture=neutral, PublicKeyToken=c5687fc88969c44d', or
one of its dependencies, was not found.]
TheHudsonDrags.BackEnd_Components.CDAL..ctor() in e:\files\web
sites\thehudsondrags\web_root\backend_components\dal.cs:23
TheHudsonDrags.Controls.News.Page_Load(Object sender, EventArgs e) in
e:\files\web sites\thehudsondrags\web_root\controls\news.ascx.cs:22
System.Web.UI.Control.OnLoad(EventArgs e) +102
System.Web.UI.Control.LoadRecursive() +45
System.Web.UI.Control.LoadRecursive() +130
System.Web.UI.Control.LoadRecursive() +130
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +952


I really don't see the problem. I have added the reference, so how does it
not know where it is? Confusing.

Any help appreciated,
Steve
 
I really don't see the problem. I have added the reference, so how does
it
not know where it is? Confusing.

Not necessarily...

1) What is the name (not the IP address) of the machine on which the
instance of mySQL is running?

2) What client are you using to (try to) connect to it?

3) Are you trying to use one of the native .NET data providers, OleDb or
ODBC?

4) What is your mySQL Connection string?
 
Mark Rae said:
Not necessarily...

1) What is the name (not the IP address) of the machine on which the
instance of mySQL is running?

2) What client are you using to (try to) connect to it?

3) Are you trying to use one of the native .NET data providers, OleDb or
ODBC?

4) What is your mySQL Connection string?

oh good, someone will help me ;)

1) mysql4.brinkster.com

2) I am trying to connect with asp.net web app. I can connect with the
"MySql Administrator" application

3) Yes, I downloaded the ado.net provider from the mysql.com site

4) server=mysql4.brinkster.com;user id=xxxxxx; password=xxxxxx;
database=xxxxxx; pooling=false
 
1) mysql4.brinkster.com
OK.

2) I am trying to connect with asp.net web app. I can connect with the
"MySql Administrator" application

OK - so we know that mySQL is actually running on that box...
3) Yes, I downloaded the ado.net provider from the mysql.com site

And installed it? And added it as a Reference into your ASP.NET project?
4) server=mysql4.brinkster.com;user id=xxxxxx; password=xxxxxx;
database=xxxxxx; pooling=false

Hmm - that doesn't look quite right... Is that similar to the examples for
the .NET provider you got from the web?

I've only ever used the CoreLabs native .NET data provider, in which case
the string would look something like:

"User ID=root; Password=xxxxxx; Host=mysql4.brinkster.com; Port=3306;
Database=xxxxxx;Direct=true; Protocol=TCP; Compress=false; Pooling=true; Min
Pool Size=0;Max Pool Size=100; Connection Lifetime=0"
 
Mark Rae said:
OK - so we know that mySQL is actually running on that box...


And installed it? And added it as a Reference into your ASP.NET project?
Yes, I installed it and from what I can tell, it simply copied the dll to
the C:\Program Files\MySql\etc, etc, etc...
Hmm - that doesn't look quite right... Is that similar to the examples for
the .NET provider you got from the web?
That is the connection string that I was given from my host. It's not the
connection string that is the problem(yet) because if I even try to allocate
a MySqlCommand object like this MySqlCommand command = new MySqlCommand() I
will get the exception.
I've only ever used the CoreLabs native .NET data provider, in which case
the string would look something like:

"User ID=root; Password=xxxxxx; Host=mysql4.brinkster.com; Port=3306;
Database=xxxxxx;Direct=true; Protocol=TCP; Compress=false; Pooling=true; Min
Pool Size=0;Max Pool Size=100; Connection Lifetime=0"

I'm wondering if there are libraries in the MySql Server app that I need to
have?
 
That is the connection string that I was given from my host. It's not the
connection string that is the problem(yet) because if I even try to
allocate
a MySqlCommand object like this MySqlCommand command = new MySqlCommand()
I
will get the exception.

Hmm - does the mySql object appear in the Object Browser? If you expand the
References folder under your project in the Solution Explorer, is it there
too?
I'm wondering if there are libraries in the MySql Server app that I need
to
have?

Well, to use the CoreLabs native .NET data provider, all you have to do is:

1) install it (obviously!)

2) add a reference to it into your project
 
Mark Rae said:
Hmm - does the mySql object appear in the Object Browser? If you expand the
References folder under your project in the Solution Explorer, is it there
too?
Yes, it shows as "MySql.Data"
Well, to use the CoreLabs native .NET data provider, all you have to do is:

1) install it (obviously!)

2) add a reference to it into your project
Sadly this is not an option for me. My web host only uses the .net
connector from mysql.com - so I'm stuck getting this to work somehow.

I tried adding the dll to by application's bin folder which I have seen
people suggest on the web. This just creates a whole new kind of error
(posted below)


<code>
Parser Error Message: File or assembly name 'MySql.Data,
Version=1.0.4.20163, Culture=neutral, PublicKeyToken=c5687fc88969c44d', or
one of its dependencies, was not found.

Source Error:

Line 9: </appSettings>
Line 10: <system.web>
Line 11: <compilation
Line 12: defaultLanguage="c#"
Line 13: debug="true"
</code>
 
Sadly this is not an option for me. My web host only uses the .net
connector from mysql.com - so I'm stuck getting this to work somehow.

Ah - sorry, then, but I think I'm out of options...
I tried adding the dll to by application's bin folder which I have seen
people suggest on the web. This just creates a whole new kind of error
(posted below)


<code>
Parser Error Message: File or assembly name 'MySql.Data,
Version=1.0.4.20163, Culture=neutral, PublicKeyToken=c5687fc88969c44d', or
one of its dependencies, was not found.

Well, to me that looks very much like an incomplete or failed installation
of the .NET data provider. What did your ISP's tech support suggest...?
 
Back
Top