What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 15370 |  Welcome, Guest!   Register  Login
 Home > Interview Questions > Exclusive Interview Questions > Exclusive ADO.NET Interview Questions > How can we add relation between tables i ...

How can we add relation between tables in a Dataset?

Category: ADO.NET | Difficulty Level: Intermediate | Views:4147



Answer:

Dim objRelation As DataRelation
objRelation=New
DataRelation("CustomerAddresses",objDataSet.Tables("Customer").Columns("Custid")
,objDataSet.Tables("Addresses").Columns("Custid_fk"))
objDataSet.Relations.Add(objRelation)

Relations can be added between “Data Table” objects using the “Data Relation” object.

Above sample, code is trying to build a relationship between “Customer” and “Addresses” “Data table” using “Customer Addresses” “Data Relation” object.


Get Questpond's 500+ .NET Interview preparation videos at discounted price

Found interesting? Add this to:


Page copy protected against web site content infringement by Copyscape
>> Write Response - Respond to this post and get points

More ...

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/22/2013 7:07:41 PM