Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1

    Default filtering records based on users input



    this is my problem with my system, I have a simple combobox control in my form in order to search the users, i want to filter the records in my database based on users input(like you search in google there is a drop down list)I want my combobox drop down when it matches the criteria to the database. this is my code, but it doesnt work, am using vb.net 2005

    con.open()
    ds = new dataset()
    cmd = new oledbcommand("Select SerialNumber from Itemname where SerialNumber Like ' % " & me.Combobox1.Text & " % ' ", con)
    da = new oledbdataAdapter(cmd)
    da.fill(ds,"Itemname")
    me.combobox1.datasource = ds.tables("Itemname")
    me.combobox1.displaymember="SerialNumber"
    me.combobox1.dropdwnstyle = combobox1.simple
    me.combobox1.dropdown = true
    me.combobox1.Autocompletemode = combobox1.SuggestAppend

    please do help, i never seen this in google. thank you so much.

  2. #2
    'bro vb.net 2008 ako gamit..

    'try dw ang DropdownStyle kay Dropdown bro
    'para ma.check if naa sulod ang combobox
    'if naa,
    'i think naa pa kuwang ana bro....

    combobox1.AutoCompleteSource=Listitems

    'try dw ni bro
    '

  3. #3
    i try it naman bro, but still it doesnt work, walay mo drop down, murag npa ni kulang ngali, the same raman ni sa 2008 bro, giunsa nimo imoha? thank you

  4. #4
    'ing.ani ako paagi bro:

    Public Sub FillCombobox(ByVal cboCombo As ComboBox, ByVal sSQL As String, ByVal strTable As String, ByVal strDisplayMember As String, ByVal strValueMember As String)

    ''Try
    '' OpenDB()

    '' Dim da As SqlDataAdapter = New SqlDataAdapter(sSQL, cn)
    '' Dim dt As New DataSet

    '' da.Fill(dt, strTable)

    '' cboCombo.DataSource = dt.Tables(strTable).DefaultView
    '' cboCombo.DisplayMember = strDisplayMember
    '' cboCombo.ValueMember = strValueMember
    ''Catch ex As Exception
    ''
    ''Finally
    '' cn.Close()
    ''End Try
    Try
    Dim myConn As SqlConnection = New SqlConnection(cnString)
    Dim da As SqlDataAdapter = New SqlDataAdapter(sSQL, myConn)
    Dim dt As DataTable = New DataTable(strTable)

    da.Fill(dt)
    cboCombo.DataSource = dt
    cboCombo.DisplayMember = strDisplayMember
    cboCombo.ValueMember = strValueMember

    Catch ex As Exception

    End Try

    End Sub

    'then pgtawag kay:

    FillCombobox(cboCustomer, "SELECT CustID,CustName FROM tbl_000_Customer ORDER BY CustName", "tbl_000_Customer", "CustName", "CustID")

    '...usually sa designer mn ko mag.set sa iya source... .XSD
    '...designer sab ko mgset properties s combobox... try lang ...

  5. #5
    lamat kaau bro, ako ni i try imong code. thanks again, ill give u feedback then

  6. #6
    Quote Originally Posted by peterparker View Post
    this is my problem with my system, I have a simple combobox control in my form in order to search the users, i want to filter the records in my database based on users input(like you search in google there is a drop down list)I want my combobox drop down when it matches the criteria to the database. this is my code, but it doesnt work, am using vb.net 2005

    con.open()
    ds = new dataset()
    cmd = new oledbcommand("Select SerialNumber from Itemname where SerialNumber Like ' % " & me.Combobox1.Text & " % ' ", con)
    da = new oledbdataAdapter(cmd)
    da.fill(ds,"Itemname")
    me.combobox1.datasource = ds.tables("Itemname")
    me.combobox1.displaymember="SerialNumber"
    me.combobox1.dropdwnstyle = combobox1.simple
    me.combobox1.dropdown = true
    me.combobox1.Autocompletemode = combobox1.SuggestAppend

    please do help, i never seen this in google. thank you so much.

    when ni ma execute nga mga lines? while nag type ka sa combo box nga ni actas textbox?

    if wa ko msayup cross thread operation mana.

  7. #7
    hmmm.. install sa nko akong visual studio bro. years na nga wala ko nakagamit ana da. kadali lang

  8. #8
    as the user type the combobox it will filter letter by letter pero based ni sa field sa database bro example serialnumber, kana ra ang mag dropdown sa combobox bro. thank you

  9. #9
    ok bro lamat kaau

  10. #10
    ms access akong gamit ani mga bro

  11.    Advertisement

Page 1 of 2 12 LastLast

Similar Threads

 
  1. filtering records based on users input
    By peterparker in forum Programming
    Replies: 0
    Last Post: 09-10-2010, 01:03 PM
  2. filtering records based on users input
    By peterparker in forum Programming
    Replies: 0
    Last Post: 09-10-2010, 12:54 PM
  3. Best Movie That's Based On A TRUE STORY
    By cestlavie in forum TV's & Movies
    Replies: 214
    Last Post: 09-16-2008, 05:38 PM
  4. Flash game based on Portal -- for pure casual gaming
    By [DSX] in forum Software & Games (Old)
    Replies: 0
    Last Post: 01-10-2008, 05:51 PM
  5. Rate the following government institution based on your experience
    By nindotkanon in forum Politics & Current Events
    Replies: 6
    Last Post: 01-29-2006, 01:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top