OleDbDataReader getvalues prob

  • Thread starter Thread starter chiranjeeb ghosh via .NET 247
  • Start date Start date
C

chiranjeeb ghosh via .NET 247

(Type your message here)
dim myStrArray() as string
While objReader.Read()
Dim tempObj() As Object
objReader.GetValues(tempObj)
myStrArray(row) = tempObj
row = row + 1
End While

the above code is giving error
 
Hi,
You have not given what error the code is throwing. However there could be
several places the code could crash
It would be a typecast exception of some kind since u are trying to assign
an object datatype to a string datatype.
Also I hope u have inistialized the row variable.
Most important You have not created myStrArray() array just declared it.
Where is the code to create an instance of the array.
 
Back
Top