Search code examples
c#asp.netvb.netsql-like

"Like" function in a dataset stored in memory ( The same as like function in SQL )


Assume I have a large dataset and I want to run a "like" function in the dataset eg column - Name

Is there any way to run a like statement in a dataset?

Is it possible with ASP.NET?

I do not want to run a query to the database.


Solution

  • dataTable.Select("Name like '%rob%'");
    

    The LIKE statement is supported in the DataTable.Select function as documented here:

    http://msdn.microsoft.com/en-us/library/system.data.datacolumn.expression.aspx