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

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: .NET
Expertise: Beginner
Sep 16, 2008

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


Programatically Set or Change DataRow's RowState

The .NET Framework 2.0 adds a new feature: SetAdded, SetModified. You use this feature to set DataRow's RowState value programatically.

This is applicable only when the current DataRow's RowState is Unchanged.

Simply use the following steps:

  1. Make the necessary changes to the DataRow.
  2. Call AcceptChanges() for the DataRow. When invoking AcceptChanges, any DataRow object still in edit mode successfully ends its edit. Each DataRow's RowState property also changes; the Added and Modified rows become Unchanged, and the Deleted rows are removed:
    
    dsCopySess.Tables["DataTableName"].Rows[0].AcceptChanges(); 
    
  3. Set the RowState as desired:
    
    dsCopySess.Tables["DataTableName"].Rows[0].SetAdded();
    
Arun Thomas
 
Comment and Contribute

 

 

 

 

 


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

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date