0

I want to retrieve only one column from dataset or datatable. the dataset has one table and that table has many column. But I want only one column from that table. How can i do it?
And that will be still in a dataSet, not in a string.

3
Contributors
2
Replies
4
Views
7 Years
Discussion Span
Last Post by Tower-Rounder
0

may be this is what you want :
int val
val = Convert.ToInt32(ds.Tables[0].Rows[0]["FieldName"]);

0
//Table with multiple columns
            DataTable dt1 = new DataTable();

            //Table with chosen column
            DataTable dt2 = dt1.Columns["ColumnName"].Table;
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.