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. Web Development
  3. ASP.NET
  4. ddl binding

ddl binding

Scheduled Pinned Locked Moved ASP.NET
helpdatabasewpfwcfquestion
6 Posts 6 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.
  • B Offline
    B Offline
    brettokumar
    wrote on last edited by
    #1

    hi i am binding values from database to ddl through sqldatareader records are binding in my dripdownlist but my first record is dosen't bind i.e if i have 4 records in my table. ddl is binding only three records from 2 to 4 only dosen't bind 1st record. shall i know what is the problem please help me...

    with regards, bretto

    B S S M 4 Replies Last reply
    0
    • B brettokumar

      hi i am binding values from database to ddl through sqldatareader records are binding in my dripdownlist but my first record is dosen't bind i.e if i have 4 records in my table. ddl is binding only three records from 2 to 4 only dosen't bind 1st record. shall i know what is the problem please help me...

      with regards, bretto

      B Offline
      B Offline
      Bardy85
      wrote on last edited by
      #2

      Please could you paste your code. Are you sure are reading all the records. How are you binding the data?

      N 1 Reply Last reply
      0
      • B brettokumar

        hi i am binding values from database to ddl through sqldatareader records are binding in my dripdownlist but my first record is dosen't bind i.e if i have 4 records in my table. ddl is binding only three records from 2 to 4 only dosen't bind 1st record. shall i know what is the problem please help me...

        with regards, bretto

        S Offline
        S Offline
        Sandeep Akhare
        wrote on last edited by
        #3

        First thing is Debug the application And see what you are getting from database.

        Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... " Check My Blog

        1 Reply Last reply
        0
        • B brettokumar

          hi i am binding values from database to ddl through sqldatareader records are binding in my dripdownlist but my first record is dosen't bind i.e if i have 4 records in my table. ddl is binding only three records from 2 to 4 only dosen't bind 1st record. shall i know what is the problem please help me...

          with regards, bretto

          S Offline
          S Offline
          SomeGuyThatIsMe
          wrote on last edited by
          #4

          dont call sqlReader.Read() just set the datasource for the dropdown, the DataTextField, and the DataValueField, to whatever column you want them to be(the text field is what is displayed) and call the DataBind function on the drop down.

          Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

          1 Reply Last reply
          0
          • B brettokumar

            hi i am binding values from database to ddl through sqldatareader records are binding in my dripdownlist but my first record is dosen't bind i.e if i have 4 records in my table. ddl is binding only three records from 2 to 4 only dosen't bind 1st record. shall i know what is the problem please help me...

            with regards, bretto

            M Offline
            M Offline
            musclebai
            wrote on last edited by
            #5

            the person above has given the exact answer....this is what msdn has to say about the Reader.Read()----Advances the reader to the next block of data in cases where the reader contains more than one block.So the first call gets u past the first record i believe.

            1 Reply Last reply
            0
            • B Bardy85

              Please could you paste your code. Are you sure are reading all the records. How are you binding the data?

              N Offline
              N Offline
              neelaveni k
              wrote on last edited by
              #6

              objDDL.fillDDL(ddlState, "codstate", "", False, Constants._DDL_Default_Select) objDDL.fillDDL(ddlDistrict, "CODDistrict", "", False, Constants._DDL_Default_Select) objDDL.fillDDL(ddlCity, "CODcity", "", False, Constants._DDL_Default_Select) using ddlstate,district,city tables

              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