Question about LoadDataRow method...

  • Thread starter Thread starter Thomas Hill
  • Start date Start date
T

Thomas Hill

I am trying to use the SqlDataAdapter.LoadDataRow() method to do what the
MSDN documentation says: Fill an object array witht he primary key values,
then attempt to either find the row or prepare for a new one. However, when
I run my test program and examine the returned datarow contents (on a row I
KNOW exists), all the columns other than the ones I filled in the array are
set to DbNull. Tow possibilities come to mind:

1. I am using an object array with elements for all the columns in the table
(33), but filling only the first two (the primary key columns), assuming the
LoadDataRow method will fill in the rest. Is this fouling up the location
of the mathcing row?

2. Does the LoadDataRow method work??
 
Never mind. I think I found my mistake. The LoadDataRow attempts to locate
the row in the DATATABLE, not the DATABASE. Since the Datatable is empty,
no row is found...
 
Back
Top