Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to add Primary key in DataSet

Answer Posted / kamalakannan.a

If we use c#

DataTable dt=new DataTable();

DataColumn Dc1 = new DataColumn("No", Type.GetType
("System.Int32"));

dt.Columns.Add(Dc1);

//Set Primary key
DataColumn[] dc = new DataColumn[1];
dc[0] = dt.Columns["No"];
dt.PrimaryKey = dc;

Kamal..

Is This Answer Correct ?    34 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between data grid and data repeater?

1140


What are all the different methods under sqlcommand?

1031


Explain what are acid properties?

1058


Explain which name space is used to get assembly details?

1024


What are good ado.net object to replace to ado recordset object.

1207


What is the use of ADO.NET and XML web services?

1089


What is the difference between Response.Expires and Reponse.ExpiresAbsolute?

1081


What is dbcontext and dbset in entity framework?

982


Is bulk insert faster than insert?

966


What is difference between datatable and dataset?

1131


What is different between sqlcommand object and command behavior object?

1128


Which property is used to check whether a DataReader is closed or opened?

1089


Does dapper use ado.net?

1071


What are the advantages using ado.net?

1089


What is the difference in record set and dataset?

1069