I am working on a dataset with has several records in it and I have a method which accepts a datatable as an input parameter.
For example, I have a dataset named
dsDetails and one of the table in it is
Charges with the following data
Type Rate Name
B 14 bbb
A 10 ABC
C 12 ccc
I am passing the above datatable to my c# method as follows
Everything looks fine, but now that I want to filter the above datatable by type and want to pass the datatable with records of
May I know good way to do that to pass a filtered datatable?
You probably want to use a DataView object for that:
DataView dv = new DataView(dsDetails.Tables["Charges"]); dv.RowFilter = "Type = 'A'"; Populate(dv.ToTable());