Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Combo Box

Combo Box

Scheduled Pinned Locked Moved C#
tutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sajid salim khan
    wrote on last edited by
    #1

    :rose::rose:How to Fill Combo Box From SQL2000 Tables :rose:SAS

    L R 2 Replies Last reply
    0
    • S sajid salim khan

      :rose::rose:How to Fill Combo Box From SQL2000 Tables :rose:SAS

      L Offline
      L Offline
      laddie 0
      wrote on last edited by
      #2

      SqlCommand cmd = new SqlCommand("SELECT [field] FROM table",connection); SqlDataReader dataReader = cmd.ExecuteDataReader(); while(dataReader.Read()) { comboBox1.Items.Add(new llistItem(dataRead[0],dataRead[0]); } dataRead.Close(); Hope this helps

      1 Reply Last reply
      0
      • S sajid salim khan

        :rose::rose:How to Fill Combo Box From SQL2000 Tables :rose:SAS

        R Offline
        R Offline
        rohitsrivastava
        wrote on last edited by
        #3

        hi this is the coding to fill the combo strselect="select fieldname from tablename " objsqlconn=new sqlconnection("userid=sa;password=;data source=servername") objsqlconn.open() objdataset=new dataset objsqlcmd=new sqlcommand(strselect,objsqlconn) objsqldataadapter=new sqldataadapter(objsqlcmd) objsqldataadapter.fill(objdataset,"Tablename") cmbname.datasourc=objdataset.table("Tablename") cmbname.displaymember="Fieldname" cmbname.displayvalue="fieldname" this is how to fill the combo have a nice day

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups