I have received a data table from the SQL server and for now, I want to show those records that "vocId" is equal to 1. but the following code represents all records. what can I do to fix it?
DataTable dt = new DataTable();
DataTable dtFetch = new DataTable();
dt = cls.sentencesFetch();
var result = from r in dt.AsEnumerable()
where r.Field<int>("vocId").ToString() == 1.ToString()
select r;
DataView view = result.AsDataView();
dtFetch = view.Table;
dgv.DataSource = dtFetch;