NewRow method changes values in a reference to another row?!

D

Dwaine

Using .NET Framework 1.1.

I do a select for a row, assign a strongly typed var to
reference/change the row thuought the rest of the code(OrigRow).
After various responses from the user that change some column values
of OrigRow, I begin a transaction and select(By PK) for the row again
to bring it into the transaction. I use the strongly typed NewRow
method of the datatable and assign it to another variable(NewRow) to
add a new row based on some of the user responses.

Right after the newrow method is executed, the column values of both
OrigRow and NewRow change to the original db values of OrigRow!!!???

DA.Fill(DS.DT) 'select *

OrigRow as DTRow = DT.rows(0)

'here, OrigRow.Qty = 10
.....
do some work,
OrigRow.Qty += 10 'proposed value = 20
....

'now work is done, start a transaction...
conn.open
conn.BeginTransaction

'change cmd obj for PK
DA.Fill(DS.DT) 'select where ID = OrigRow.ID, assigned to Txn
'In retrospect, shouldn't this reset values of OrigRow? Another
thread!

'now create a new row for another reason
NewRow as DTRow = DT.NewRow
'RIGHT HERE, OrigRow Values AND NewRow Values change to pre-work
values of OrigRow!!!!???? e.g., OrigRow.Qty = 10 AND NewRow.Qty = 10,
NOT NULL!!??


Anybody else see this or able to explain what I'm seeing, I'm going
CRAZY!

Thanks for any help,
Dwaine
 
G

Guest

dwaine, I feel for you. You can see my problems in my
two posts surrounding yours. All the books and articles
I read brag how ado used 'magic' to do it's database
functions, but ado.net exposes the insides.

I find it just the opposite. I could actually do things
in ado after skimming a chapter. in ado.net I'm killing
myself and can't get things to work right. The Micorsoft
guys who intervene haven't been able to solve my problems
either.

dennist
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top