coexisting connections

IxiRancid

Well-known member
Joined
Jun 16, 2004
Messages
104
Location
Europe
I know that a connection with two different DataReaders cannot exist at the same time.
Im doing this:
1. reading from a table and replicating these same rows
2. then these replicated rows should have Updated linked columns (IDfak - not the pirmary ID though!)

pseudocode:
connection open
Reader1 SELECT statement (Command1)
While read
add parameters from Reader1 to Command2, except IDfakt (new value)
Command2 INSERT (replicate) these rows - executenonquery
End While
connection close

Is there another way to do this. I attached a TXT file with the code snip.
 

Attachments

OK ok... problem solved.
This was it, if you cehck the TXT file:
...
While drPOSTAVKE.Read

cmdPostavka = New OleDbCommand(strINSERT, myConnPostavke)

s_IDopisa = drPOSTAVKE(2)
...

just initialize the Command again.
Thanks anyway.
 
Back
Top