Home All Groups Group Topic Archive Search About

DataTable for just one record - most efficient?

Author
12 Dec 2006 5:15 PM
pjsimon
I've searched the forum, but I couldn't find an answer in the existing posts...

I am executing an SQL query which I know will return only one record.  I
will then insert a record, then delete the record I returned from the DB.  Is
using the DataTable the most effiecient way to do this?

PJSimon

Author
12 Dec 2006 10:41 PM
DanielReis
I advise you to use transactions in your code! It's the eficient way to do
this!
Read the record to the datatable, and then begin the transaction! if the
delete goes wrong you could roll back the insert.

DanyR.


Show quoteHide quote
"pjsimon" wrote:

> I've searched the forum, but I couldn't find an answer in the existing posts...
>
> I am executing an SQL query which I know will return only one record.  I
> will then insert a record, then delete the record I returned from the DB.  Is
> using the DataTable the most effiecient way to do this?
>
> PJSimon