|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Datatable = dataset.Tables("Supplier") ?(101 vb.net samples). Public Class frmMain Private dsSupplierProducts as DataSet Private dtSupplier as DataTable Private dtProducts as DataTable Private dvSupplier as DataView Private dvProduct as DataView Sub GetDateSet() m_DAL = new DataAccess () 'Data access tier. dsSupplierProducts = m_DAL.CreateDataSet() ' this returns one dataset with two tables, Supplier & Products 'Set variables for the DataTables for use later dtSupplier = dsSupplierProducts.Tables("Supplier") dtProducts = dsSupplierProducts.Tables("Products") 'Set up Dataviews for the datagrid dvSupplier = dtSupplier.DefaultView dvProduct as dtProducts.DefaultView end Sub Sub BindProductsGrid() .... dvProducts.RowFilter = "Suppliers = " & strCurrentSupplierID With grdProducts .CaptionText = "whatever" .DataSource = dvProducts end With End Sub What I don't understand are the lines dtSupplier = dsSupplierProducts.Tables("Supplier") dtProducts = dsSupplierProducts.Tables("Products") Do these assignments populate separate, distinct datatables with the two tables from the dataset? IE: the data now exists in two places? Or are the datatables just pointers to the original dataset.datatables (dsSupplierProducts.Tables(".."))? Changes made to data in the grids is passed back to the data access tier like: m_DAL = new DataAccess() m_DAL.UpdateDataSet(dsSuppliersProducts.GetChanges()) Thanks Tom -- E-mail correspondence to and from this address may be subject to the North Carolina Public Records Law and may be disclosed to third parties. Hello Tom,
dtSupplier and dtProducts should both be references to their respective tables in dsSupplierProducts. Any changes made to one should be reflected in the other. -Boo Show quoteHide quote > What I don't understand are the lines > dtSupplier = dsSupplierProducts.Tables("Supplier") > dtProducts = dsSupplierProducts.Tables("Products") > Do these assignments populate separate, distinct datatables with the > two tables from the dataset? IE: the data now exists in two places? > Or are the datatables just pointers to the original dataset.datatables > (dsSupplierProducts.Tables(".."))? > > Changes made to data in the grids is passed back to the data access > tier > like: > m_DAL = new DataAccess() > m_DAL.UpdateDataSet(dsSuppliersProducts.GetChanges()) > Thanks > Tom
Timer driving me nuts
OK, new registry question Tree List View Listview - get value multiple columns validating textbox vfp oledbcommand [Fail] How do I add a c++ library to my vb.net project? looking for tree/outline control that allows in-place editing AND will expand as I type Looping through data adapter Jet error message when trying to create a DS from Excel |
|||||||||||||||||||||||