dropdown, textbox search mysql database, result in gridview

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rajsrmc
    New Member
    • Jan 2010
    • 9

    dropdown, textbox search mysql database, result in gridview

    Hello experts
    Let's say I have a gridview with some columns like, title, name, funding agency. Here's an example of what I want to do:

    I want to display all the records in the gridview to start. There would be a dropdownlist that lets the user select whether to search by title, name, funding agency and a text box that lets them type in what they want to search for (and a button to start the search). After searching, the gridview would only display the records that matched the criteria.

    i already know how to connect datasets to the gridview, but i am using mysql database and writing code in vb.

    how to accomplish this task
    any help will be really appreciated
    thanks
  • CroCrew
    Recognized Expert Contributor
    • Jan 2008
    • 564

    #2
    Hello rajsrmc,

    By your own submission you know how to do most of this. Create a form place a drop down list next to a text box and button control. Below the three controls place a data grid that will get populated based on the values from the drop down list and the text entered in the text box.

    After you give it a try first yourself and find that you are not getting the results that you are looking for then please post your code here and we will be happy to provide you with a solution to your coding problems.

    Happy Coding,
    CroCrew~

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      To create a column in your GridView that displays data in a DropDownList you will be interested in using a TemplateField. These fields let you specify what controls are bound to the data in the column.

      Check it out.

      -Frinny

      Comment

      Working...