C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Programatically set or change DataRowState


Posted Date: 16 Jan 2008    Resource Type: Code Snippets    Category: ADO.NET

Posted By: Arun Thomas       Member Level: Gold
Rating:     Points: 7



NET Framework 2.0 is having a new Feature --> SetAdded, SetModified
where you can set the RowState programatically.

NET Framework 2.0 is having a new Feature --> SetAdded, SetModified
where you can set the RowState programatically.

This is applicable only when the current DataRow state is UnChanged.

The Steps are as follows

Step 1) Make necessary changes to the datatow

Step 2) Call AcceptChanges() for the datarow. When invoking
AcceptChanges, any DataRow object still in edit-mode successfully ends
its edit. The RowState property of each DataRow also changes;
Added and Modified rows become Unchanged, and Deleted rows are removed.


dsCopySess.Tables["DataTableName"].Rows[0].AcceptChanges();


Step 3) Set the RowState to what you require


dsCopySess.Tables["DataTableName"].Rows[0].SetAdded();












Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Using Transactions
Previous Resource: Different Text Colors in DDL and Listbox
Return to Discussion Resource Index
Post New Resource
Category: ADO.NET


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

efax

Contact Us    Privacy Policy    Terms Of Use