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

Description

Gets the name of the column.

Syntax

dbreaderInstance.Name(int columnNumber)

Arguments

ClassNameDescription
intcolumnNumberA column number.

Return value

ClassDescription
stringThe column name.

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:

string name = dbr.Name(0);

6:

dbr.Release();

7:

cmm.Release();

8:

cnn.Close();

9:

cnn.Release();

Notes

The index (column number) is zero-based.

If there is a column corresponding to the index, return its name. Otherwise it returns an empty string.

Links for reference

None.

Copyright © Rice All rights reserved.