473,408 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Datatable = dataset.Tables("Supplier") ?

code snipped from MS sample "N-Tier Data Form and Data Layer" example
(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.
Aug 28 '06 #1
1 1285
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
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

Aug 28 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Dam | last post by:
Using SqlServer : Query 1 : SELECT def.lID as IdDefinition, TDC_AUneValeur.VALEURDERETOUR as ValeurDeRetour FROM serveur.Data_tblDEFINITIONTABLEDECODES def,...
3
by: Martin | last post by:
Hello everybody, I have the following question. As a join clause on Oracle we use " table1.field1 = table2.field1 (+) " On SQL Server we use " table1.field1 *= table2.field1 " Does DB2...
13
by: andro | last post by:
Hi everybody! I have several tables from which I want to exract the SAME value (along with other referenced data). All the values are in the same column within the tables. How can I achieve...
1
by: cyningeston | last post by:
OS: WinXP Pro, VB/ASP/ADO.NET I'm building a web-based supplier management application. For each supplier we are required by the FDA to track certain documents. I've managed to pull them from...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.