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. Web Development
  3. rendering the value in radiobuttonlist control

rendering the value in radiobuttonlist control

Scheduled Pinned Locked Moved Web Development
helpdatabasedesignsysadmin
4 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.
  • U Offline
    U Offline
    uglyeyes
    wrote on last edited by
    #1

    Hi! I am having a strange error. I have two same application with two same database running in two different server. The code to render radiobuttonlist in both application was rdoPSWPriority.SelectedValue = DSInfo.Tables(0).Rows(0)(23).ToString DSInfo is a datatable where there is no value present in this record one of my server works fine while another server gives me error like NumberSystem.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. at System.Web.UI.WebControls.ListControl.set_SelectedValue(String value) at Inspections.inspection.Page_Load(Object sender, EventArgs e) in .... and stops to run the code I just couldnt figure out what might be causing this problem I can do sumthing like If DSInfo.Tables(0).Rows(0)(23).ToString <> Nothing Then rdoPSWPriority.SelectedValue = DSInfo.Tables(0).Rows(0)(23).ToString End If but there are like hundreds of radio button so i am just being lazy please help

    A 1 Reply Last reply
    0
    • U uglyeyes

      Hi! I am having a strange error. I have two same application with two same database running in two different server. The code to render radiobuttonlist in both application was rdoPSWPriority.SelectedValue = DSInfo.Tables(0).Rows(0)(23).ToString DSInfo is a datatable where there is no value present in this record one of my server works fine while another server gives me error like NumberSystem.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. at System.Web.UI.WebControls.ListControl.set_SelectedValue(String value) at Inspections.inspection.Page_Load(Object sender, EventArgs e) in .... and stops to run the code I just couldnt figure out what might be causing this problem I can do sumthing like If DSInfo.Tables(0).Rows(0)(23).ToString <> Nothing Then rdoPSWPriority.SelectedValue = DSInfo.Tables(0).Rows(0)(23).ToString End If but there are like hundreds of radio button so i am just being lazy please help

      A Offline
      A Offline
      Akhilesh Yadav
      wrote on last edited by
      #2

      This is not null error. See the exception: ArgumentOutOfRangeException The value which you want to select by using rdoPSWPriority.SelectedValue = DSInfo.Tables(0).Rows(0)(23).ToString in buttonlist is not present. Try to get the data which is filling buttonlist and then check the value which you are assigning is present in that data. I think this might help you

      Regards, Akhilesh Yadav

      U 1 Reply Last reply
      0
      • A Akhilesh Yadav

        This is not null error. See the exception: ArgumentOutOfRangeException The value which you want to select by using rdoPSWPriority.SelectedValue = DSInfo.Tables(0).Rows(0)(23).ToString in buttonlist is not present. Try to get the data which is filling buttonlist and then check the value which you are assigning is present in that data. I think this might help you

        Regards, Akhilesh Yadav

        U Offline
        U Offline
        uglyeyes
        wrote on last edited by
        #3

        I mean this happens only when no value is selected. and it was woring fine in one server even when i dont select any value but in another server it gives me taht exception

        A 1 Reply Last reply
        0
        • U uglyeyes

          I mean this happens only when no value is selected. and it was woring fine in one server even when i dont select any value but in another server it gives me taht exception

          A Offline
          A Offline
          Akhilesh Yadav
          wrote on last edited by
          #4

          try changing your query. B'coz since there is null while you asssing it gives this exception. Do following changes: 1. In your dropdown list give a default which will get selected if there is not selection. 2. Change your query, if query returns null value for 23rd col then change it to the default selection value of dropdown list. for e.g. if it oracle you can change nvl(tbl.colname,0) here 0 is the value of default selection in dropdown list. Hope it helps you

          cheers, Akhilesh Yadav

          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