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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Windows Forms
  4. Combobox datasource remains null even after assigned with a dataset

Combobox datasource remains null even after assigned with a dataset

Scheduled Pinned Locked Moved Windows Forms
help
6 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.
  • R Offline
    R Offline
    Ramya Bhaskaran
    wrote on last edited by
    #1

    Hi, In my code, if I assign a dataset to the combobox datasource property,it is not getting assigned. The combobox datasource remains null. Because of this the combobox is not getting populated with the data.Can Some one tell me what could be the problem

    B.RAMYA

    P 1 Reply Last reply
    0
    • R Ramya Bhaskaran

      Hi, In my code, if I assign a dataset to the combobox datasource property,it is not getting assigned. The combobox datasource remains null. Because of this the combobox is not getting populated with the data.Can Some one tell me what could be the problem

      B.RAMYA

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      A couple of things occur. 1. Is this an ASP.NET app? I'm asking, because even though you've posted in the WinForms section I don't want to make any assumptions. If so, you need to call DataBind(). 2. Have you set the DisplayText/DisplayValue?

      Deja View - the feeling that you've seen this post before.

      My blog | My articles

      R 1 Reply Last reply
      0
      • P Pete OHanlon

        A couple of things occur. 1. Is this an ASP.NET app? I'm asking, because even though you've posted in the WinForms section I don't want to make any assumptions. If so, you need to call DataBind(). 2. Have you set the DisplayText/DisplayValue?

        Deja View - the feeling that you've seen this post before.

        My blog | My articles

        R Offline
        R Offline
        Ramya Bhaskaran
        wrote on last edited by
        #3

        It is a C# .net application and I have set the Display Member and the value member .The thing is that combobox datasource remains null even after assigned with a dataset.

        B.RAMYA

        D 1 Reply Last reply
        0
        • R Ramya Bhaskaran

          It is a C# .net application and I have set the Display Member and the value member .The thing is that combobox datasource remains null even after assigned with a dataset.

          B.RAMYA

          D Offline
          D Offline
          darkelv
          wrote on last edited by
          #4

          dataset or datatable?

          R 1 Reply Last reply
          0
          • D darkelv

            dataset or datatable?

            R Offline
            R Offline
            Ramya Bhaskaran
            wrote on last edited by
            #5

            I have the following code in my application m_DataTable= XmlDataSet.XmlToDataSet(xmlOutput).Tables[0]; While debugging I have checked the value of m_DataTable and it has data.But datasource of the combobox remains null even after assigning. cboTypeID.DataSource = m_DataTable; cboTypeID.DisplayMember = "Play"; cboTypeID.ValueMember = "Play"; cboTypeID.SelectedIndex = -1; The thing is that the same code Works fine in others Systems

            B.RAMYA

            modified on Friday, April 11, 2008 1:29 AM

            P 1 Reply Last reply
            0
            • R Ramya Bhaskaran

              I have the following code in my application m_DataTable= XmlDataSet.XmlToDataSet(xmlOutput).Tables[0]; While debugging I have checked the value of m_DataTable and it has data.But datasource of the combobox remains null even after assigning. cboTypeID.DataSource = m_DataTable; cboTypeID.DisplayMember = "Play"; cboTypeID.ValueMember = "Play"; cboTypeID.SelectedIndex = -1; The thing is that the same code Works fine in others Systems

              B.RAMYA

              modified on Friday, April 11, 2008 1:29 AM

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              I asked if it was an ASP.NET system - not C# (that seemed to be a given). If it's an ASP.NET page, you need to call DataBind() after you set the data source.

              Deja View - the feeling that you've seen this post before.

              My blog | My articles

              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