No accessible overloaded 'DataRowCollection.Add' can be called without a narrowing conversion.

  • Thread starter Thread starter Bill Nguyen
  • Start date Start date
B

Bill Nguyen

What do I need to do to add a row to a table with single column? I got the
"mnarrowing conversion" ewrror mesage.

Thanks



Bill

-----------------



Dim rValue(0) As Object

rValue(0) = CInt("1001")

dS.Tables(0).Rows.Add(rValue(0))

Error:
Additional information: No accessible overloaded 'DataRowCollection.Add' can
be called without a narrowing conversion.
 
The Add method is expecting an Array of type Object, not one element of an
Array of type Object.

ds.Tables(0).Rows.Add(rValue)

should work.

Tony
 
Thanks Tony;
This works well.
one more thing, can I sort the DS.Tables(0) after adding this new row?

Bill
 
Back
Top