473,394 Members | 1,773 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,394 software developers and data experts.

Foxpro Question

Hello there, just been thrown in the deep end with .NET, I need to perform
the equivalent of "Set Relation" using CSharp and ADO.NET on two Foxpro
tables. My basic needs are: Open two Foxpro tables, relate them using two
common fields, scan through every record ( loads of logic goes here... )
create and write to an output table. I know how to open, read, and write,
but am at a loss as to how to join them on their common fields ( or if it's
possible !?)

any help much appreciated
Regards,
Peter J. Kane
Nov 17 '05 #1
3 1437
Peter,

This is easy. First, you want to load the data from the two tables into
DataTable instances in the same data set (you have to do this because data
in .NET is not ambient, like it is in FoxPro, but I believe you know this).

Once you do that, you can create DataRelation instances which indicate
which table is the parent, which is the child, and the fields that are used
to bind the two tables.

Then, while cycling through the rows in the parent table, you can call
the GetChildRows method on the DataRow, passing in the DataRelation object,
and it will give you the records in the child table that are related to that
row in the parent table.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Pete Kane" <pj**********@uku.co.uk> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hello there, just been thrown in the deep end with .NET, I need to perform
the equivalent of "Set Relation" using CSharp and ADO.NET on two Foxpro
tables. My basic needs are: Open two Foxpro tables, relate them using two
common fields, scan through every record ( loads of logic goes here... )
create and write to an output table. I know how to open, read, and write,
but am at a loss as to how to join them on their common fields ( or if
it's
possible !?)

any help much appreciated
Regards,
Peter J. Kane

Nov 17 '05 #2

very helpful, thanks very much
regards

Pete Kane
*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #3
thanks Nicholas, very helpful

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:u2**************@TK2MSFTNGP09.phx.gbl...
Peter,

This is easy. First, you want to load the data from the two tables into DataTable instances in the same data set (you have to do this because data
in .NET is not ambient, like it is in FoxPro, but I believe you know this).
Once you do that, you can create DataRelation instances which indicate
which table is the parent, which is the child, and the fields that are used to bind the two tables.

Then, while cycling through the rows in the parent table, you can call
the GetChildRows method on the DataRow, passing in the DataRelation object, and it will give you the records in the child table that are related to that row in the parent table.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Pete Kane" <pj**********@uku.co.uk> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hello there, just been thrown in the deep end with .NET, I need to perform the equivalent of "Set Relation" using CSharp and ADO.NET on two Foxpro
tables. My basic needs are: Open two Foxpro tables, relate them using two common fields, scan through every record ( loads of logic goes here... )
create and write to an output table. I know how to open, read, and write, but am at a loss as to how to join them on their common fields ( or if
it's
possible !?)

any help much appreciated
Regards,
Peter J. Kane


Nov 17 '05 #4

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

Similar topics

13
by: Simon Bailey | last post by:
I am a newcomer to databases and am not sure which DBMS to use. I have a very simplified knowledge of databases overall. I would very much appreciate a (simplifed) message explaining the advantages...
3
by: sparks | last post by:
All we are hearing at work now is we should give up on access. NO NO NO you need to go with foxpro. access is dead and can't do anything compared to foxpro It can make coffee, and forward...
2
by: Salad | last post by:
OS = WinXP & Win98. Access = A97 & AXP Q1) Where can I find the VFP ODBC driver at Microsoft. I have been working developing an app in Access that will link to some DOS FoxPro tables. I...
0
by: Salad | last post by:
My operating system is WinXP Pro. I have 1 gig of memory and the chip is an Intel Pentium 4. I am using Access97. A table has been supplied to me from an external source createdc from Visual...
1
by: David Sorber via AccessMonster.com | last post by:
Hello, I've got two questions. Im writing an Access 2000 database to collect data from multiple Visual Foxpro Databases, total some figures, save the data into a table for archiving purposes, and...
7
by: Sascha Schmidt | last post by:
Hello ! I have a little problem accessing a Visual Foxpro-database using ODBC (Driver 6.00.8167) (using System.Data.Odbc). Reading a column, defined in the Foxpro table definition as a kind of...
2
by: Amedee Van Gasse | last post by:
Hello, Since it is the first time I'm posting in these groups, I believe a (short) introduction of myself would not be a bad thing. I am mainly a support engineer, not a programmer. I do have...
2
by: Songyang | last post by:
I'm new to this group. In my company in Japan, we have been using dbase for almost 20 years, and we are now switching to foxpro. Dose anybody here has experience in converting dbase programs from...
0
by: diston52 | last post by:
Hello,,, I'm Don I'm currently working on a system to track contacts for a railroad in a nearby town. I am using Visual Studio 2005 and SQL Server Express. The client has purchased a package...
7
by: z71mdridin | last post by:
I have an asp.net website that uses Form authentication to authenticate users. I need to provide users with a report based on FoxPro data that resides on a remote server. When I attempt to...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.