SQL againts Dataset

hadinatayp

Well-known member
Joined
Feb 8, 2006
Messages
95
Programming Experience
Beginner
Can i use sql syntax againts dataset1, to get some results and then save (add) them to dataset2?

(suppose i have fill the dataset1 with records, on form load events)


thx!.
 
Am not very clear on what u r exactly looking for.


If u need something like applying a filter on the rows of dataset1 and then adding them rows to dataset2, u can do it.


Select method of datatable can be used for this. The Select method takes a filter expression as parameter. The SQL "where clause" condition should be specified as the filter expression.

For example:
(This example assumes Dataset1 is already populated with all the rows from Orders Table. )

A SQL filter like
select * from orders where ORD_ID<10

could be given as

dim dr() as datarow
dr = Dataset1.tables("Orders").select("ORD_ID<10")

Then this dr() can be added to the rows collection of dataset2 by using ADD method of the datatable.
 
Back
Top