Home Notices Documents Classes Download Others Rice
Classes  >  dbreader  >  Get(int)
dbreader class : Get(int) method

Description

Returns the value of the given column.

Syntax

dbreaderInstance.Get(int columnNumber)

Arguments

ClassNameDescription
intcolumnNumberA column number.

Return value

ClassDescription
int, long, real, string, or dbnullA value of the column.

Sample code

1:

connection cnn = new connection("Data Source=c:\somedirectory\somedatabase.sqlite3;Version=3;");

2:

cnn.Open();

3:

command cmm = new command("select * from sometable where id < 100;", cnn);

4:

dbreader dbr = cmm.Reader(); // Command execution. A multi-line result is returned.

5:

while(dbr.Read())

6:

long value = dbr.Get(0); // The value of the first column. The first column is assumed to be an integer column.

7:

endwhile

8:

dbr.Release();

9:

cmm.Release();

10:

cnn.Close();

11:

cnn.Release();

Notes

Please note that the return type from the method depends on the type actually stored.

When you retrieve a value from an integer column, the value is returned as an instance of the long class.

Links for reference

None.

Copyright © Rice All rights reserved.