You can create a dataset object by including the System.Data namespace as dataset class is inside this namespace only.
The below program will help you to include the dataset namespace and also create a dataset object by specifying the name of dataset.
Sample program to create a dataset object and include the namespace:
using System;
using System.Data;
namespace DemoConsoleApplication
{
class DataSet_NameSpace
{
static void Main(string[] args)
{
//Create a object of dataset
DataSet oDs = new DataSet("TestDataset");
Console.WriteLine("DataSet Created.");
Console.WriteLine("DataSet Name:" + oDs.DataSetName);
Console.ReadLine();
}
}
}
No comments:
Post a Comment