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
374 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
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

828 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