473,836 Members | 2,235 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1458
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.co m

"Pete Kane" <pj**********@u ku.co.uk> wrote in message
news:%2******** ********@TK2MSF TNGP14.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.c om> wrote in
message news:u2******** ******@TK2MSFTN GP09.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.co m

"Pete Kane" <pj**********@u ku.co.uk> wrote in message
news:%2******** ********@TK2MSF TNGP14.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
13365
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 and disadvantages of both programs. Many Thanks Simon
3
1815
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 your email....bla bla bla to the people who have used both...what do you say to these people. who have never used or programmed in either one.
2
6606
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 have been doing my development work in A97 but the folks have AXP at their site. As near as I can tell, the FoxPro driver has been discarded from A97 and replaced with ODBC in A2K onward
0
1790
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 FoxPro file, version 6.0. If I connect to it using File/GetExternalData/Link and select FoxPro as the file type and it links OK. I press Open and the table opens just like an Access table...quickly. There are 557 records. The problem is that...
1
3122
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 be able print out a report. Im connecting to the Foxpro Databases using ODBC through VB version 6 and my Visual Foxpro Driver is dated at 12/7/1999 version 6.01. 1.When connecting to a particular Foxpro database my access program completely...
7
7336
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 binary char (i'm no foxpro-expert and the database is predetermined) and containing Unicode-String, delivers a byte structure in the resulting DataSet. Showing this column in a Datagrid only results in displaying "byte" instead of a value. Now...
2
2536
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 some experience with Java and LAMP (Linux/Apache/MySQL/PHP) but don't consider me one of those boring OS advocates please. ;-) I also have done a little bit with Visual Basic (and GwBasic in a long forgotten past) and nowadays my job involves...
2
2336
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 Dbase to Foxpro ones? It seems the data conversion is not hard. But we have hundreds of dbase programs that need to be converted to foxpro ones. Could you please give me some advice? And here special tools for this?
0
1131
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 developed in Foxpro, and I am presented with the challenge of onterfacing the system with the package they have purchased. My question is, what is the best way to connect to the Foxpro database, so I can transfer data between the applications. I am...
7
5502
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 connect to the Foxpro directory by using the ODBC DSN that we currently use in ColdFusion, I get the following message: ERROR File 'table.dbf' does not exist. I know this is probably a permissions issue because asp.net is being
0
9657
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10823
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10577
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10243
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9359
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7775
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4443
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4003
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3103
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.