DataAdapter.fill() to execute an Update statement???

  • Thread starter Thread starter Kevin Yu
  • Start date Start date
K

Kevin Yu

hi all

got a burning question here. in a data access layer, a DataAdapter.fill()
method is used to execute an update statement without any select in a store
procedure.

what happen is it works without any problem in a few level of testing
environment without getting caught, now the code is breaking is production.
it seems like it works fine a for a while in production until this May 13,
friday (not to mention that we worked on the 13 floor.) all of a sudden, all
hell break through, things start to mulfunctioning this afternoon.

my question is why does it work for such a long time ( a few months with
hardness testing and all) and doesn't work today?

I guess cause come down to this incorrect call for the statement type. any
inside?

thx


Kevin
 
Use DataAdapter.Fill() to execute an UPDATE statement? It just simply dead
wrong. Even it workrked for you for whatever mystrial reason, it is just
wrong. DataAdapter is the bridge between memory-resident data object
(DataSet/DataTable) and data store. Fill() (look at its name: Fill) is for
grab data from data store and FILL the data into DataSet/DataTable.
DataAdapter also has multiple methods called Update(), which is designed to
update data changes back to data store. You can also directly use Command
object to update database without using DataAdapter. I do not believe
Friday/13th causes Fill() not updating any more, because it should not by
design.
 
I have write a little test app to run the insert statement with a
DataAdapter.fill() method.
it works like a charm. what I did is write a value to the database and read
it back to compare
the two values, I run the test for a million time, they are equal for the
million time.

I dont' know what to say, well, you can say million + 1 time won't work, you
might be right,
but why did it works for million times?

I know the FILL() statement is not supposed to run the insert SQL statement,
I didn't write the
code, I also try to prove it wrong here. so that I can explain why.

anymore thoughts?

Kevin
 
Back
Top