0

My ASP.NET web application is not recognizing DataSet and DataAdapter. Which namespace is required to create a new DataSet?

1
  • Are you saying you don't know what namespaces to include with the "using" directive? Commented Sep 11, 2009 at 4:06

5 Answers 5

6

Namespace

using System.Data;

OR Directly

System.Data.DataSet ds = new System.Data.DataSet();
Sign up to request clarification or add additional context in comments.

Comments

2

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.DataSet
System.Data.Common.DataAdapter

So add these using statements at the top of your file:

using System.Data;
using System.Data.Common;

Comments

2

System.Data

For a typed DataSet, you can check the typed DataSet file's (.XSD file) .CS/.VB file; it will show the namespace.

Comments

1

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.

Comments

1

just import system.data and imports system.data.oledb

in c# replace imports by using.

Comments

Your Answer

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.

Ask question

Explore related questions

See similar questions with these tags.