Monday, January 30, 2012

Accessing data from the Dataset

A data set i collection of tables where each table is represented in the form of a class as data table and identified by it's index position or name

Dataset:
collection of tables(DataTable)
[dataset].Tables[index] or Tables[name]
ds.Tables[0] or ds.Tables["students"]
Every data table is again a collection of row and cols where each row is represented in the form of a class known as DataRow and Identified by it's by index position,each column is represented in the form a class known as DataCol and Identified by it's Index position or name

Data Table:
//collection of Row(DataRow)
[datatable].Rows[index]

//collection of columns(DataColumn)
[datatable].columns[index]or columns[name]
ds.Tables[0].columns[0] or ds.Tables[0].columns["sno"]

//Retriving to a cell under the Data Table
[datatable].Rows[row][col]
ds.Tables[o].Rows[0][0]or
ds.Tables[0].Rows[0]["sno"]

No comments:

Bel