Solved

Why asp.net can't find my namespace if I already added the reference dll to the project?

Posted on 2008-10-16
7
373 Views
Last Modified: 2012-08-14
I have a simple ASP.NET 3.5 project in c# to test out the code from
http://www.codeproject.com/KB/database/mysqlmembershipprovider.aspx
This code just uses a couple of files that require a reference to MySQL.

I already installed the MySQL data connector for .Net and already added the reference to that dll to my project.

I already created an "App_Code" folder to my project and placed both files in it.
Also tried changing the property "Build Action" of each file to "Compile".

Anyway, no matter what I do, I get the error below as if I did not have a reference to "MySQL.Data" which I definitely have.

Compiler Error Message: CS0246: The type or namespace name 'MySql' could not be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 4:  using System;
Line 5:  using System.Data;
Line 6:  using MySql.Data.MySqlClient;



0
Comment
Question by:rudy2024
  • 3
  • 3
7 Comments
 
LVL 7

Expert Comment

by:pr0t0c0l12
ID: 22734846
They mentioned in the description that the classes DOESN'T work with MySql.  They work with ODBC so you might want to use an Access database.
Hope this helps.
0
 
LVL 13

Accepted Solution

by:
TechTiger007 earned 50 total points
ID: 22734928
I hope that you have checked in "Reference" list  that MySql.Data entry is displayed.

This happened few times for me and it worked fine once I restarted visual studio.
Also try to copy the dll to bin folder of the application and try again
0
 

Author Comment

by:rudy2024
ID: 22735142
Thanks, I did have the "MySQL.Data" dll visible under my "References" listbox but anyway, I followed your advice and copied the file from GAC to my "Bin" folder and that took care of it.  Why ? I don't know.  Good thing is that it works!
Thank you.
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 13

Expert Comment

by:TechTiger007
ID: 22735234
You may have clicked AcceptMultipleSolution button instead of Accept as Solution
0
 

Author Comment

by:rudy2024
ID: 22735330
Thanks I must have done that.
0
 

Author Closing Comment

by:rudy2024
ID: 31506894
Hopte this finally closes the solution.  Sorry for the trouble, it's first time I post a question.
0
 
LVL 13

Expert Comment

by:TechTiger007
ID: 22735362
You are welcome
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now