Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hii Friends

I am using Grid view to show data to user n my page

In grid page I have one search box when I try to bind data of searching then it not bind that data it bind all data. my code is as below any one please tell me what I am doing rong

C#
public void gridbind()
    {
        DataSet ds = new DataSet();
        Master_Select objmaster = new Master_Select();

        objmaster.Select_Master(ds);
        GridView1.DataSource = ds;
        GridView1.DataBind();
    }

public void searchbind(string search_txt, string search_type)
    {
        
        if (search_type == "Name")
        {

            DataSet ds = new DataSet();
            //ds.Tables[0].Rows.Clear();

            Master_Search obj_search = new Master_Search();
            obj_search.Search_select_Master(ds_search, search_txt);
            GridView1.DataSource = ds_search;
            GridView1.DataBind();
        }
    }


gridbind (); method is for binding all data to grid

seaech_bind(); is for binding search result on grid

when I am using search then I get my searched data up to "ds_search" but it is not binding to grid view
Posted

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