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. Data Bindings again

Data Bindings again

Scheduled Pinned Locked Moved C#
help
2 Posts 2 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
    rzvme
    wrote on last edited by
    #1

    I tried every piece of code possible. The latest is: comboSelect1.DataBindings.Add("DisplayMember", dsDenumiri1.Tables["Denumiri"], "Statie_Nume"); comboSelect2.DataBindings.Add("DisplayMember", dsDenumiri2.Tables["Denumiri"], "Statie_Nume"); comboSelect1.DataBindings.Add("ValueMember", dsDenumiri1.Tables["Denumiri"], "StatieID"); comboSelect2.DataBindings.Add("ValueMember", dsDenumiri2.Tables["Denumiri"], "StatieID"); but i just can't bind these 2 comboboxes to the datasets! the error is the same: An unhandled exception of type 'System.ArgumentException' occurred in system.dll Additional information: Could not bind to the new display member. Please Help me!! rzvme

    B 1 Reply Last reply
    0
    • R rzvme

      I tried every piece of code possible. The latest is: comboSelect1.DataBindings.Add("DisplayMember", dsDenumiri1.Tables["Denumiri"], "Statie_Nume"); comboSelect2.DataBindings.Add("DisplayMember", dsDenumiri2.Tables["Denumiri"], "Statie_Nume"); comboSelect1.DataBindings.Add("ValueMember", dsDenumiri1.Tables["Denumiri"], "StatieID"); comboSelect2.DataBindings.Add("ValueMember", dsDenumiri2.Tables["Denumiri"], "StatieID"); but i just can't bind these 2 comboboxes to the datasets! the error is the same: An unhandled exception of type 'System.ArgumentException' occurred in system.dll Additional information: Could not bind to the new display member. Please Help me!! rzvme

      B Offline
      B Offline
      Bogdan Damian
      wrote on last edited by
      #2

      Hi First you shouldn't add two bindings to the same cotrol. Second for the combo you have the list datasource which is the datatable in your case and which uses DisplayMember and ValueMember and also you have the current record which you want to edit. You should try to use only one binding on "StatieID" and when the combo value is changed change the name. ALso you should check that the datasource set on the combo contains the two columns ("Statie_Nume", "StatieID") damianbc

      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