nadeem_zzz
nadeem_zzz

Reputation: 21

ASP.NET not recognizing dataset and data adapter

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

Upvotes: 0

Views: 4917

Answers (5)

Abhishek
Abhishek

Reputation: 997

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

in c# replace imports by using.

Upvotes: 1

Jay Riggs
Jay Riggs

Reputation: 53593

System.Data

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

Upvotes: 2

KV Prajapati
KV Prajapati

Reputation: 94645

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.

Upvotes: 1

Andrew Hare
Andrew Hare

Reputation: 351506

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;

Upvotes: 2

Muhammad Akhtar
Muhammad Akhtar

Reputation: 52241

Namespace

using System.Data;

OR Directly

System.Data.DataSet ds = new System.Data.DataSet();

Upvotes: 6

Related Questions