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 !






How to use DataRelation in ADO.NET


Posted Date: 15 Sep 2008    Resource Type: Code Snippets    Category: ADO.NET

Posted By: Prafulla S Shimpi       Member Level: Gold
Rating:     Points: 10



This is very helpful class when your Dataset contains more than one table.
You can set up relationships between two tables using this class, setting up relationship between two DataColumn objects.

VB.Net Implementation of the same is:


Dim objPrCol As System.Data.DataColumn
Dim objCldCol As System.Data.DataColumn

objPrCol = dsInvestors.Tables["Investors"].Columns["InvestorId"];
objCldCol = dsInvestors.Tables["Orders"].Columns["InvestorId"];

Dim objRel As System.Data.DataRelation = [ic:ccc]new System.Data.DataRelation("InvestorOrders", [ic:ccc]objPrCol , objCldCol )
dsInvestors.Relations.Add(objRel )

It automatically takes care of the relation while CRUD operations.


There is class level detailed information provided on MSDN for the same.

This is usually recommended to use with Database handling with RDBMS.




For more details, visit http://msdn.microsoft.com/en-us/library/system.data.datarelation.aspx




Responses


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

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
ADO.Net DataRelation  .  

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: ID Auto Generation
Previous Resource: How to Create Relations in Data Set using ADO.NET
Return to Discussion Resource Index
Post New Resource
Category: ADO.NET


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

teleconferencing service

Contact Us    Privacy Policy    Terms Of Use