Select :
private void BindGrid()
{
var query = from p in db.StudentTables select new { p.StudentID, p.StudentName,p.Mobile,p.Email };
GridView1.DataSource = query;
GridView1.DataBind();
}
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.
Sanjay KumarPosted Oct 19, 2013, 7:30 AM
no overload for method arguments
Jaganathan BantheswaranPosted Oct 19, 2013, 5:50 AM
Add a overloaded BindGrid function like this,
private void BindGrid(string name)
{
var query = from p in db.StudentTables where p.StudentName.Equals(name) select new { p.StudentID, p.StudentName,p.Mobile,p.Email };
GridView1.DataSource = query;
GridView1.DataBind();
}
call this from click event like,
protected void btnSearch_Click(object sender, EventArgs e)
{
BindGrid(txtSearch.text);
}
Sanjay KumarPosted Oct 19, 2013, 5:34 AM
{
//code help
}
Sanjay KumarPosted Oct 19, 2013, 4:05 AM
Jaganathan BantheswaranPosted Oct 19, 2013, 3:42 AM
What is your problem here?