Forum Moderators: open

Message Too Old, No Replies

What does OleDbDatareader.Getvalue means?

         

dragonist

9:27 am on Jul 5, 2004 (gmt 0)

10+ Year Member



I found the definition in the msdn but it didn't explain much, while others website has confused me. MSDN said it returns the value of the specified column in the current row datareader is reading about, while other website said it returns the value of the rows.

And what does it actually returns? Type int32? Can it be int16 as well? Return the value does it mean return the info on the specified column of the specified rows? Or the number of order of the row/column?
Thanx

Mr_Brutal

3:25 pm on Jul 9, 2004 (gmt 0)

10+ Year Member



From a quick scan it looks like it returns the value of the column of the row that the reader is currently at.

Basically:

Table
Row1
Column1 - NO: 1
Column2 - Desc: Red
Column3 - Name: Small Widget
Column4 - Number: 3

Row2
Column1 - NO: 2
Column2 - Desc: Blue
Column3 - Name: Big Widget
Column4 - Number: 3

While at row 1
OleDbDatareader.Getvalue(0) would return: 1
While at row 2
OleDbDatareader.Getvalue(2) would return: Big Widget

This is because it takes a zero-based integer that correpsonds to the column you want.

I haven't actually used .NET yet but if i when i do thats what i'd expect this function to do!

(How are you meant to 'write' tables by the way, i hope you can understand the above)