I have the following:
Dim dt As DataTable = ds.Tables(0)
Tables(0) has about 20 columns. I like to select only a couple. “PrID” is one of the fields.
I tried
Dim dt As DataTable = ds.Tables(0).Select("PrID")
without any success. Any idea?
One way is using the
DataRowextension methodFieldwhich is strongly typed and supports nullable types:Edit: If you want another
DataTablewith a subset of columns of the original DataTable you can use theDataViewof the table and it’sToTablemethod: