473,406 Members | 2,698 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,406 software developers and data experts.

DataTable record access

Is there any way to directly access a DataTable record, or is sequential
access the only way? Does having a foreign key contraint between parent and
child DataTables in any way facilitate accessing child table records?

Thanks,

Keith
Sep 14 '06 #1
2 1349

"keithb" <kb******@dslextreme.comwrote in message
news:ek**************@TK2MSFTNGP02.phx.gbl...
Is there any way to directly access a DataTable record, or is sequential
access the only way?
it depends. Once loaded in a table, you can query for records, which is not
possible in a DataReader while building the table.
Does having a foreign key contraint between parent and child DataTables in
any way facilitate accessing child table records?
Yes, esp. with Strongly Typed DataSets. To do so, you have to add
relationships to the two DataTables (in a DataSet) and ask for child rows.
With Strongly Typed DataSets, there is intellisense. I wrote a blog entry on
STDs earlier today:

http://gregorybeamer.spaces.live.com

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think Outside the Box!
*************************************************
Sep 15 '06 #2
Awesome blog!!! Thank you

When you say "Once loaded into a table, you can query for records," do you
mean a database table, or can you somehow query against a DataTable? If so,
please tell me how?

Thanks,

Keith

"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamMwrote in
message news:OZ**************@TK2MSFTNGP04.phx.gbl...
>
"keithb" <kb******@dslextreme.comwrote in message
news:ek**************@TK2MSFTNGP02.phx.gbl...
>Is there any way to directly access a DataTable record, or is sequential
access the only way?

it depends. Once loaded in a table, you can query for records, which is
not possible in a DataReader while building the table.
>Does having a foreign key contraint between parent and child DataTables
in any way facilitate accessing child table records?

Yes, esp. with Strongly Typed DataSets. To do so, you have to add
relationships to the two DataTables (in a DataSet) and ask for child rows.
With Strongly Typed DataSets, there is intellisense. I wrote a blog entry
on STDs earlier today:

http://gregorybeamer.spaces.live.com

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think Outside the Box!
*************************************************

Sep 15 '06 #3

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

Similar topics

0
by: VMI | last post by:
My windows app contains a process that loads data to a datatable. Is it possible to load this data into an Access table with exactly the same table structure? For example, if my process adds 100...
4
by: Stephen | last post by:
I am trying to add some code to below to include a datatable and fill the datatable. The reason for doing this is so as I can check to see whether there are any rows returned by the stored...
12
by: VMI | last post by:
For some reason, the process of retrieving data (about 20 records) from an Access table that has 400K records to a dataTable is taking over 3 mins. to complete. Below is my code to connect to the...
1
by: JohnR | last post by:
I'm using oledb to an Access datatable. I load the table into a dataset. I create databindings to link the fields on my form to the corresponding fields in the datatable. The tables...
4
by: oopman2002 | last post by:
I have created a DataSet DataTable which is comprised of data from a number of sources. The resultant datatable is about 500,000 records and writing them out one at a time takes forever. Does...
6
by: Tim Kelley | last post by:
If I have a datatable with 1 record only, can I reference the data in the row without a for loop? I can get to the data by using the following code, but it would be nice if I didn't have to use...
0
by: rajg78 | last post by:
Hi All, First time I am posting, so please forgive me if I miss out any information while asking you my question. I have a .net web app that I am building in 2.0 framework. I have a code-behind...
5
by: jehugaleahsa | last post by:
Hello: What is the point of using a DataTable in ASP .NET? We are unsure how you can use them without 1) rebuilding them every postback, or 2) taking up precious memory. We are not sure how to...
2
by: Eric B. | last post by:
I could use a little clarification on using a BindingSource with my DataTable. As I understand it, the BindingSource sits between my data source (a DataTable) and DataGridView and any changes made...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.