Thursday, March 29, 2012

Loop

Hello,
I created a connection to a database and everything is fine. Finally I
wrote this:
connection.Open()
**** MyFunction( [ Title Field ], [ Text Field ], [ Link Field
]) ****
connection.Close()
I need to loop trough all records and call a function as I wrote in
****
How can I do this?
Thanks,
MiguelYou don't have any records to loop through just because you have a
database connection.
First you have to create a Command object with a query that specifies
the data that you are interrested in. Then you have to execute the
command so that you get a result. If you for an example use a DataReader
to handle the result, you can use the methods of the DataReader to loop
through the result.
shapper wrote:
> Hello,
> I created a connection to a database and everything is fine. Finally I
> wrote this:
> connection.Open()
> **** MyFunction( [ Title Field ], [ Text Field ], [ Link Field
> ]) ****
> connection.Close()
> I need to loop trough all records and call a function as I wrote in
> ****
> How can I do this?
> Thanks,
> Miguel
>

0 comments:

Post a Comment