Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Aug 27, 2013, 1:12 AM EDT
can you plz provide more details.
KRayudu V157 reputationPosted Aug 27, 2013, 1:19 AM EDT
for example in gridview we have columns like
textbox1 textbox2 textbox3
Name Address ID
suppose if we type A in textbox1 for that particular Column(Name) data has to search. the same way,it has to search each and every column in gridview
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 27, 2013, 2:18 AM EDT
First create a procedure like below
then in your code
GrdiView1.DataSource=dt;
GrdiView1.DataBind()
Regards,
Iftikar
KRayudu V157 reputationPosted Aug 27, 2013, 2:31 AM EDT
i done with data bind in gridview for that i have to implement search records column wise(EX:Suppose my field name is CITY, and i have records like Bangalore,Hyderabad,Chennai,Maysore)if i enter B in textbox it has to search B in that column.i does not search from other columns(SPECFIC COLUMN RECORDS)
KRayudu V157 reputationPosted Aug 27, 2013, 2:31 AM EDT
i done with data bind in gridview for that i have to implement search records column wise(EX:Suppose my field name is CITY, and i have records like Bangalore,Hyderabad,Chennai,Maysore)if i enter B in textbox it has to search B in that column.i does not search from other columns(SPECFIC COLUMN RECORDS)
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 27, 2013, 2:33 AM EDT
KRayudu V157 reputationPosted Aug 27, 2013, 3:14 AM EDT
protectedvoidPage_Load(objectsender, EventArgs e)02{03if(!IsPostBack)04{05BindGrid();06}07}08privateDataTable GetRecords()09{10SqlConnection conn =newSqlConnection(strConnection);11conn.Open();12SqlCommand cmd =newSqlCommand();13cmd.Connection = conn;14cmd.CommandType = CommandType.Text;15cmd.CommandText ="Select * from Employees";16SqlDataAdapter dAdapter =newSqlDataAdapter();17dAdapter.SelectCommand = cmd;18DataSet objDs =newDataSet();19dAdapter.Fill(objDs);20returnobjDs.Tables[0];2122}23privatevoidBindGrid()24{25DataTable dt = GetRecords();26if(dt.Rows.Count > 0)27{28grdSearch.DataSource = dt;29grdSearch.DataBind();30}31}Iftikar HussainRank #423 · 5.9K reputationPosted Aug 27, 2013, 3:18 AM EDT
Regards,
Iftikar