Description:
In this example we explain that how to select certain columns
of data table in C#.or how to fetch some specific column from Data Table in C#.or
how to get some column from select statement in Data Table using C#.
Here we have one Data Table in which it’s contain many
columns but I want to just fetch or retrieve some specific column so to achieve
this below is the code foe how to retrieve some specific columns form Data
Table in C#.
string[] selectedColumns = new[] { "Name","City"};
DataTable dt=
new DataView(fromDataTable).ToTable(false, selectedColumns);
0 comments:
Post a Comment