Monday, November 11, 2019

Filter DataTable or Find in DataTable

1. string type

 DataRow[] rw = dt.Select("ManuName='masters'");

2. integer type

 DataRow[] rw = dt.Select("Srno=1");


Othe example

if (dt.Rows.Count > 0)
{
    DataRow[] rw = dt.Select("ManuName='masters'");
    foreach (DataRow r in rw)
    {
        if (Convert.ToBoolean(r["view_"]) == true){
        %>
        <li><a href="<%=r["form_name"] %>"><i class="fa fa-circle-o"></i><%=r["form_name"] %></a></li>
        <%}
    }
}

No comments:

Post a Comment

Linq Expression syntax for where condtion in linq

(Expression<Func<T, bool>> filter)