Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: .NET
Expertise: Beginner
Jan 28, 2009

Add an AutoIncrement Column to a DataTable

Adding an AutoIncrement column to a DataTable is quite simple: When you create a DataColumn, set its AutoIncrement property to true. The following code demonstrates:

DataColumn posId = table.Columns.Add("PositionId", typeof(int));
posId.AutoIncrement = true;
Srinath MS
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap