I've this error:
"ObdcException was unhandled by user code"
I dont know why this...
This is the connection string:
<add name="MiniBoxConnection" connectionString="DRIVER={MySQL ODBC 5.1 Driver};Database=DATABASENAME;Server=SERVERNAME;UID=USER;PWD=PASS;"/>
how can i solve this problem?
i'm developing in the localhost, but database is online
The name of the data source was not found and there was no default driver specified
You are attempting to connect to your MySQL database from your .net code using ODBC. Your error message is telling you that you haven't created an appropriately named ODBC data source object (DSN). You can do that with the ODBC Data Source Adminstrator control panel if you need to.
If I were you I would use Connector/NET instead of ODBC. It performs better and it isn't quite such a pain in the neck to configure correctly.
You can download the install kit for it here. http://dev.mysql.com/downloads/connector/net/
You'll need to change your code for this. But, it's worth it! Seriously! Your code will end up looking like this.
Try this to connect and test your connection: