Problem with MySQL and ASP.NET

devottam

New Member
Messages
2
Reaction score
0
Points
0
Hi guys,

I've been trying to load my site which is in ASP.NET. Thinking it would be good to test before uploading the whole site, I wrote very simple code to test connectivity to database (MySQL) and creating a table.

First I tested on my machine (which has MySQL 5.1 community server and ODBC driver 5.1) it ran without any glitch. Then I uploaded the files and created database in mysql server (x10hosting).

Page loads fine but when i click to crate the table it shows an error about libodbc.so file.

the error looks like this

"libodbc.so
Description: HTTP 500. Error processing request.
Stack Trace:
System.DllNotFoundException: libodbc.so at (wrapper managed-to-native) System.Data.Odbc.libodbc:SQLAllocHandle (System.Data.Odbc.OdbcHandleType,intptr,intptr&) at System.Data.Odbc.OdbcConnection.Open () [0x00000]"


I am confused as what to do.
Thank you in advance.
Enjoy.
 

Hue Kares

New Member
Messages
38
Reaction score
6
Points
0
First I tested on my machine (which has MySQL 5.1 community server and ODBC driver 5.1) it ran without any glitch. Then I uploaded the files and created database in mysql server (x10hosting).

devottam, don't use the ODBC driver, use the .Net connector instead... Follow the instructions in this tutorial to successfully connected to a SQL database using ASP/Net. If you require further information, please post back; someone will help you.
 

devottam

New Member
Messages
2
Reaction score
0
Points
0
@ Hue Kares
thank you !

well the stuff on the link is good and insightful but the web.config file looks messy coz same thing is defined multiple times.
here is mine that i used

<?xml version="1.0"?>
<configuration>
<system.web>
<customErrors mode="Off"/>
<compilation>
<assemblies>
<add assembly="MySql.Data"/>
</assemblies>
</compilation>
</system.web>
<connectionStrings/>
</configuration>

the connection worked and i am happy.
thank you!
 
Top