Click here to Skip to main content
15,943,245 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Friends, my Code for search data from sql 2008 database with asp.net4 using EF like this:
C#
public List<string> GetSearchPCs()
{
    List<string> SLNo = new List<string>();
    using (PCEntities myEntity = new PCEntities())
    {
        var data = from s in myEntity.ItemSets where s.PCSLNo.Contains(txtSearch.Text) select s;
        foreach (var s in data)
        {
            S PCSLNO.Add(s.SlNo + " " + s.MonitorSlNo + " " + s.SNo);
        }
        return SLNo;
    }
}
//Next, just I need to bind this function to a data control:
protected void txtSearch_TextChanged(object sender, EventArgs e)
{
    GridView1.DataSource = GetSearchPCs();
    GridView1.DataBind();
}


Now I need to design the GridView columns but unable to do so. Please help me how to do it with GridView or Repeater etc. Waiting for solution from you all friends. Thank You
Posted
Updated 18-Mar-12 4:59am
v3
Comments
ProEnggSoft 18-Mar-12 10:54am    
Edit: pre tag for C# code added - PES

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900