Search code examples
asp.netmysqlvisual-web-developer

Data source name not found and no default driver specified


The Error

ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

The Story

I've written a page outside of Visual Web Developer 2010 that uses a SqlDataSource object along with a FormView object that works perfect. Building upon those awesome skills I obtained I started to build a project within Visual Web Developer, this time creating an Empty Web Application and went along my happy way building my new site. I used the same techniques and almost the same code as before - just pointing to a different table but I was met with the aforementioned error message.

The Confusing part

Here's the puzzling part - if I take my page I wrote outside of Visual Web Developer, again - it works perfect - no complaints, and add it as a page to the project I've built it now presents the same error message and I have no idea why.

The Tests Completed

I've backed off of targeting .NET 4.0 framework and went to 2.0 as I am not using any specific 4.0 controls or methods at this time. I've taken my page that originally gave me issue and recreated it outside of a Visual Web Developer project and instead as a stand alone page and the exact same code - copy, cut, paste - works perfect!

The Solution...

At this point I'm left puzzled and mouth agape. Any help is appreciated why building a project in Visual Web Developer would cause anything different.


Solution

  • I should learn to read the answers to my own questions I posted no more than 2 weeks ago.

    MySQL ODBC fails in C# .NET project but not runtime compiled code

    Updating the connectionString to

    DRIVER={MySQL ODBC 5.1 Driver};

    instead of

    DRIVER={MySQL ODBC 3. Driver};

    seems to have corrected the issue once I fixed a stupid SQL Insert Statement issue.

    Thanks for the help mwalker.