Linq query of search option
please provide linq query of searching .
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Mukesh Kumar TiwariPosted Feb 20, 2014, 1:10 AM
{
Fill_Grid();
}
=========================================
public void Fill_Grid()
{
var grid_data = from area in linq.Chk_Area_Masters
where area.Isdelete == 0 && area.Area_name.Contains(txt_search.Text)
select new
{
Area_Id = area.Area_id,
Area_Name=area.Area_name,
Enter_By=area.Created_by,
Enter_Date=area.Created_Date,
Update_By=area.Updated_by,
Update_date=area.Updated_Date,
};
if (grid_data.Count() > 0)
{
dataGridView1.DataSource = grid_data;
}
}
==============================================================
You can Make also Simple query like below..
var search_Data=from area in linq.Chk_Area_Masters
where area.Area_name.Contains(txt_search.Text)
select area;
Data_Grtid=search_data;