Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET4.0
hi sir;
 
i want that when i click the search button the value are display or set in combo box. The values retrieved from database?
please solve my problem...
 
Thanks in advance...
Posted 20-Feb-13 11:30am
Comments
ryanb31 at 20-Feb-13 16:31pm
   
What do you have so far? Where are you stuck?
joshrduncan2012 at 20-Feb-13 16:33pm
   
My +5.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

first of all you can try by your self , in which line your facing problem just ask that line alone directly you ask code means that's not good for you.
 
Any one give a code whatever you expect but you can't understand that logic .
 
Here what i'm trying to do is i have a textbox in that i enter some text and then click on search button then based upon the search the result to be displayed on DDL.
 
You write your SQL query
SELECT COL1,COL2,COL3 FROM TABLE1 WHERE COL1 LIKE '%searchedresult%'
 
 protected void btnSearch_OnClick(object sender, EventArgs e)
    {
        Bind_Projects();
    }
 
protected void Bind_Projects()
    {
        string Search = txtSearch.Text.Trim();
        DataSet dsProj = //what do you want you fetch taht information                           
        ddlSearch.DataSource = dsProj;
        ddlSearch.DataTextField = "Proj_Description";
        ddlSearch.DataValueField = "Proj_Code";
        ddlSearch.DataBind();
        ddlSearch.Items.Insert(0, "---Select---");
    }
  Permalink  

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

  Print Answers RSS
0 Mathew Soji 309
1 BillWoodruff 300
2 Afzaal Ahmad Zeeshan 252
3 DamithSL 225
4 Maciej Los 215
0 OriginalGriff 6,249
1 Sergey Alexandrovich Kryukov 5,853
2 DamithSL 5,183
3 Manas Bhardwaj 4,673
4 Maciej Los 3,865


Advertise | Privacy | Mobile
Web01 | 2.8.1411019.1 | Last Updated 20 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100