Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 345
  • Last Modified:

Databinding dataset with multiple tables to textboxes

I have a bunch of text boxes that I would like to databind to a dataset that has two tables with a one to many relationship between them.  I am using the bindingcontext to navigate through the rows of the master table, which nicely scrolls through the data and displays it in the textboxes that are bound to the Master table.  However, I have other textboxes that I would like bound to the child table to display a value that has a relationship to the master.  

Is this possible through databinding?  if not Could someone expain how to do this??

1 Solution
Brian CroweDatabase AdministratorCommented:
create a dataview of your child table and bind to that instead of the datatable
use the dataview.rowfilter property to control what record(s) are viewable.

dim dv as new dataview(childtable)
dv.rowfilter = "FKID = " + dtMaster.rows(currentrecord).item("PKID").tostring

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now