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. SYNTAX PROBLEM -----PLS HELP ME

SYNTAX PROBLEM -----PLS HELP ME

Scheduled Pinned Locked Moved C#
helpcsharpdata-structurescryptographytutorial
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.
  • N Offline
    N Offline
    Nishad85
    wrote on last edited by
    #1

    Hi, i am working in windows application of C# i am using hash table. i want to add data to hash table from datatable named DTSchool. I have a school name in combobox. when iselect school in combo it takes the curresponding SchoolID from the datatable i want to know how to write code for that. i wrote like this List.Add(SchoolDT.Rows[cboSchool.SelectedIndex]["SchoolID"],cboSchool.Text.ToString()); .But it is not taking value from datatable.Please help me regarding this problem?

    C M 2 Replies Last reply
    0
    • N Nishad85

      Hi, i am working in windows application of C# i am using hash table. i want to add data to hash table from datatable named DTSchool. I have a school name in combobox. when iselect school in combo it takes the curresponding SchoolID from the datatable i want to know how to write code for that. i wrote like this List.Add(SchoolDT.Rows[cboSchool.SelectedIndex]["SchoolID"],cboSchool.Text.ToString()); .But it is not taking value from datatable.Please help me regarding this problem?

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      I doubt this is a syntax problem. If it was the compiler would be complaining. You have a run time error.

      sajin85 wrote:

      cboSchool.Text.ToString()

      Why are you calling ToString() on something that is already a string? Are the rows in the DataTable order the same way as the items in the combo box?


      Upcoming FREE developer events: * Glasgow: Agile in the Enterprise Vs. ISVs, db4o: An Embeddable Database Engine for Object-Oriented Environments, Mock Objects, SQL Server CLR Integration, Reporting Services ... My website

      1 Reply Last reply
      0
      • N Nishad85

        Hi, i am working in windows application of C# i am using hash table. i want to add data to hash table from datatable named DTSchool. I have a school name in combobox. when iselect school in combo it takes the curresponding SchoolID from the datatable i want to know how to write code for that. i wrote like this List.Add(SchoolDT.Rows[cboSchool.SelectedIndex]["SchoolID"],cboSchool.Text.ToString()); .But it is not taking value from datatable.Please help me regarding this problem?

        M Offline
        M Offline
        Mark Swaanenburg
        wrote on last edited by
        #3

        Hi, Are you sure the indexes of the items in your combobox matches the row indexes in your datatable? Maybe posting a little bit more code might help to tackle your problem. Mark

        Hybrid DSP: Digital processing and storage solutions. Hybrid GeoTools: Advanced GIS editing tools.

        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