No data source name was found and the specified driver is not specified by default

Mistake

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

Story

I wrote a page outside of Visual Web Developer 2010 that uses the SqlDataSource object along with a FormView object that works great. Based on the amazing skills that I got, I started creating a project in Visual Web Developer, this time creating an empty web application and, in my opinion, successfully built my new site. I used the same methods and almost the same code as before - just pointing to a different table, but I was met with the above error message.

Invalid part

Here's the cryptic part - if I take my page that I wrote outside of Visual Web Developer, again - it works fine - no complaints and adding it as a page to the project I just created presents the same error message and I have no idea why.

Tests performed

I gave up targeting the .NET 4.0 platform and switched to 2.0, as I am not currently using any specific 4.0 controls or methods. I took my page, which initially gave me the problem, and recreated it outside of the Visual Web Developer project, and instead became a separate page and the same code — copy, cut, paste — works great!

Decision...

At this moment, I remain puzzled and tired. Any help is appreciated why creating a project in Visual Web Developer will lead to something else.

0
source share
2 answers

I must learn to read the answers to my questions, which I published no more than 2 weeks ago.

MySQL ODBC crashes in a C # .NET project, but not compiled with runtime

Update connectionString to

DRIVER = {MySQL ODBC 5.1 Driver};

instead

DRIVER = {MySQL ODBC 3. Driver};

seems to have fixed the problem as soon as I fixed the stupid problem with SQL query nesting.

Thanks for helping mwalker.

0
source

If you are working (for example, debugging) your project in Visual Web Developer / Visual Studio / etc., it probably works using the built-in web server. The embedded web server is placed in the sandbox, so it does not inherit any of the attributes set in the toplevel app / website.

Where do you configure the data source name for your SQL connection? On a top-level website? In the parent application?

Does it work if you change the project properties to localize local IIS instead of working on the embedded web server?

If so, you just need to move the connection string to the local web.config file so your new application can find it.

0
source

All Articles