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
372 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
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
[MYSQL]: Delete is very slow 4 53
LINQ - C# to VB convertion 12 46
Ajax Panel Not Updating When Triggered By Timer 4 36
How many transactions can mysql handle? 3 18
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

929 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

14 Experts available now in Live!

Get 1:1 Help Now