Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Type or namespace name 'Data' does not exist in the namespace 'System'

I'm trying to build my first ASP.NET Web Forms project but I'm facing some serious problem. I created two project files in my project named: BLL and DAL. I created classes named class.cs and class1.cs in both the above files respectively. When I add using System.Data; in any of the .cs files, it displays the following errors:

1: Error CS0234 The type or namespace name 'Data' does not exist in the namespace 'System' (are you missing an assembly reference?) DAL..NET Platform 5.4
2. Error CS0234 The type or namespace name 'Data' does not exist in the namespace 'System' (are you missing an assembly reference?) BLL..NET Platform 5.4

I tried adding assembly references by right click on references -> Add reference -> Checking System.Data and rebuilding it again but it didn't help me.

When I hover mouse over using System.Data; it displays the following thing:

enter image description here

like image 405
Amanshu Kataria Avatar asked Jun 13 '16 12:06

Amanshu Kataria


2 Answers

First when you hover your "System.Data" it shows a message, which is pretty much straight forward to understand that you haven't used any classes of System.Data. When you implement those classes, this message will disappear.

Second, You got an error -

Error CS0234 The type or namespace name 'Data' does not exist in the namespace 'System' (are you missing an assembly reference?) DAL..NET Platform 5.4

So basically you have to have an assembly refernce of System.Data into your project.

Go to References and check whether System.Data Assembly exist or not. If not then install it.

Hope this will help you.

like image 198
Riddhi Avatar answered Oct 23 '22 01:10

Riddhi


You are simply missing the "System.Data" reference.

In Solutions Explorer window right click on the 'Reference' entry -> Press Add Reference -> click on Assemblies > Search for 'System.Data' -> press the check box ( I always forget this step.) -> press OK.

like image 2
fishjd Avatar answered Oct 23 '22 00:10

fishjd