Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
My ASP.NET web application is not recognizing DataSet and DataAdapter. Which namespace is required to create a new DataSet?
Namespace
using System.Data;
OR Directly
System.Data.DataSet ds = new System.Data.DataSet();
Add a comment
Well, you are going to need to reference System.Data.dll and here are the two types you are looking for with their fully-qualified names:
System.Data.dll
System.Data.DataSet System.Data.Common.DataAdapter
System.Data.DataSet
System.Data.Common.DataAdapter
So add these using statements at the top of your file:
using
using System.Data; using System.Data.Common;
System.Data
For a typed DataSet, you can check the typed DataSet file's (.XSD file) .CS/.VB file; it will show the namespace.
DataSet class belongs to System.Data namespace.
For provider classes use one of the following namespace,
System.Data.OleDB******, System.Data.SqlClient, **System.Data.Odbc, System.Data.OracleClient or vendor specific namespace.
just import system.data and imports system.data.oledb
in c# replace imports by using.
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.