The type or name of the Data namespace does not exist in the System namespace,

I am trying to create my first ASP.NET Web Forms project, but I am having a serious problem. In my project, I created two project files: BLL and DAL. I created classes named class.cs and class1.cs in both of 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 to add links to the assembly by right-clicking on the links -> Add Link -> Check System.Data and rebuild it again, but that didn't help me.

When I hovered over using System.Data; , it displays the following:

enter image description here

+7
c # namespaces
source share
2 answers

First, when you hover over “ System.Data strong>”, it displays a message that pretty straightforwardly understands that you haven't used any System.Data classes. When you implement these classes, this message will disappear.

Secondly, you received an error message -

Error CS0234 The type or name of the "Data" namespace does not exist in the "System" namespace (do you miss the assembly reference?) DAL..NET Platform 5.4

So basically you should have a reference to the System.Data assembly in your project.

Go to the links and check if the System.Data assembly exists or not. If not, install it.

Hope this helps you.

+1
source share

You simply did not provide a link to "System.Data".

In the "Solution Explorer" window, right-click on the entry "Link" → Click on "Add Link" → click on "Assemblies"> "Search on .Data System" -> check the box (I always forget this step.) → click OK .

+1
source share

All Articles