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.
 

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

Back
Top