How can we add relation between tables in a Dataset?

 Posted by ArticlesMaint on 9/17/2009 | Category: ADO.NET Interview questions | Views: 5877


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.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response