Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
This was easy in VFP how do I do it in .NET
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
VB 8.0
OS:
Vista
Network:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01233691
Message ID:
01233774
Views:
9
>Table A holds parent records.
>Table B has children.
>
>At specified invervals controlled by the user (button click), portions of table A need to be copied to table B (as in a batch posting routine).
>In VFP I would select the records from table A into a cursor and scan through it doing an insert into table B. Even with sql back end.
>
>Now what do I use for a cursor and scan loop?
>
>Do I construct a sql statement that performs an insert from a select as a stored procedure?
>
>Any help is appreciated. Type slow though I'm sorta dense.

If you need to process each record, I'd follow Bonnie's suggestion (although if you're using MM.NET, I'd probably iterate through the Entity collection instead).

If you don't need to mess to much with the records, I'd just do this in SQL (you can do this in a Stored Proc, or just pass the SQL as-is through your business object.

INSERT INTO SomeTable (field 1, field 2) SELECT field1, field2 FROM SomeOtherTable
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Reply
Map
View

Click here to load this message in the networking platform