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 !




Remove ad Merge a row in DataTable if the row already exists


Posted Date: 18 Jan 2008    Resource Type: Code Snippets    Category: Databinding

Posted By: Dhivya       Member Level: Silver
Rating:     Points: 10



1.Delcare a new DataSet and Fill the DataSet
2.Assign the dataset to a datatable
the below code says that when the value which we are searching for is found in the datatable remove the row and merge the datatable to the dataset


if (dt!= null && dt.Rows.Count > 0)
{
// gets the corresponding row from accountTable
if (dt.Tables[0] != null
&& dt.Tables[0].Rows.Count > 0)
{
dr = dt.Tables[0].Rows.Find(value);
if (dr!= null)
{
// removes the row if row exists
dt.Tables[0].Rows.Remove(dr);
}
}
// merges the datatable
ds.Merge(dt);
}







Responses

Author: girish    01 Feb 2008Member Level: Bronze   Points : 0
whta is "value" in dr = ds.Tables[0].Rows.Find( value);


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: Dynamically placing comma , In between a string
Previous Resource: adding data from dataset to listview...
Return to Discussion Resource Index
Post New Resource
Category: Databinding


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

accuconference

Contact Us    Privacy Policy    Terms Of Use