Is there a way to find a value in DataTable in C# without doing row-by-row operation?
The value can be a part of (a substring of row[columnName].value , separated by comma) a cell in the datatable and the value may be present in any one of columns in the row.
You can loop over each row of the DataTable and check the value. Alternatively you can use a PrimaryKey for your DataTable . This helps in various ways, but you often need to define one before you can use it.
var table = $('#myTable'). DataTable({ responsive: true, serverSide: true, ajax: { url: myUrl, dataSrc: '' }, fnServerData: function (sSource, aoData, fnCallback, oSettings) { oSettings. jqXHR = $. ajax({ url: myUrl, success: function (json, status, xhr) { //Do stuff } }); } });
A DataTable or DataSet object will have a Select Method that will return a DataRow array of results based on the query passed in as it's parameter.
Looking at your requirement your filterexpression will have to be somewhat general to make this work.
myDataTable.Select("columnName1 like '%" + value + "%'");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With