locked
drop-down list values not populating in the page using data set RRS feed

  • Question

  • User-1797368610 posted

    Hi,

    using below code drop-down list is not populating with the value. but text field are populating the values. is there anything wrong in the code?

    Below table result getting from dataset.

    PROJECT_NUM PHYSICAL_INSPECT_DATE DEFICIENCY_CODE LIFE_SAFETY ON_PRIOR_REP REPAIR_TIME ITEM_INSPECTED
    600002 6/8/2018 C * Y 10 1
    600002 6/8/2018 C * Y 12 2

    condDataSet = DataSet("BMA", query)

    Dim foundRow() As DataRow
    Dim projno As String

    projno = "project_num='" & Txtprojno.Text & "'"
    'projno = "project_num='" & Lblprojno.Text & "'" & " and building_id = " & Session("bld_id")
    foundRow = condDataSet.Tables(0).Select(projno)
    For i = 0 To foundRow.GetUpperBound(0)
    'If foundRow(i)("PHY_COND") = "Exterior" Then
    ' If foundRow(i)("COND_CATEGORY") = "Parapets" Then
    If foundRow(i)("ITEM_INSPECTED") = "1" Then
    'If foundRow(i)("physical_inspect_date") = "' & Txtinsp_dt.Text & " Then
    'Rdb_vfdwl_y.Checked = False
    'Rdb_vfdwl_n.Checked = True
    If Not IsDBNull(foundRow(i)("DEFICIENCY_CODE")) Then
    Ddl_fdwl_cm.SelectedValue = foundRow(i)("DEFICIENCY_CODE")
    End If
    If Not IsDBNull(foundRow(i)("LIFE_SAFETY")) Then
    Txt_fdwl_exig.Text = foundRow(i)("LIFE_SAFETY")
    End If
    If Not IsDBNull(foundRow(i)("ON_PRIOR_REP")) Then
    Ddl_fdwl_opr.SelectedValue = foundRow(i)("ON_PRIOR_REP")
    End If
    If Not IsDBNull(foundRow(i)("REPAIR_TIME")) Then
    Ntimeframe_fdwl.Text = foundRow(i)("REPAIR_TIME")
    End If
    End If Next i

    Thursday, May 17, 2018 9:55 PM

All replies

  • User36583972 posted

    Hi Rakib1,

    From your description, We cannot understand your question clearly. Please include a running demo for anyone else to be able to reproduce your issue. And provide a detailed description about the results including any exception messages.

    Best Regards,

    Yong Lu

    Friday, May 18, 2018 9:46 AM
  • User-1797368610 posted

    Thanks for your reply. all i am saying drop down value not populating event though dataset has value for that drop down. in the colored rows are drop down field where i am trying to display the value into page from dataset. 

    query = "select cond.project_num,cond.physical_inspect_date,min(deficiency_code) as deficiency_code , max(life_safety) as life_safety,max(on_prior_rep) as on_prior_rep,max(repair_time) as repair_time,icat.ITEM_INSPECTED" & _
    " from AM_OI_PHY_INSP_PHY_COND cond, AM_OI_PHY_INSP_COND_DEFICIENCY defi, AM_OI_PHY_INSP_COND_CATEGORY cat, AM_OI_PHY_INSP_ITEMS_CATEGORY icat " & _
    " where cond.project_num= '" & Txtprojno.Text & "'" & _
    " and cond.physical_inspect_date = '" & Txtinsp_dt.Text & "'" & _
    " and cond.deficiency_id=defi.deficiency_id and defi.category_id=cat.category_id and cat.ITEM_INSPECTED=icat.ITEM_INSPECTED " & _
    " group by cond.project_num,cond.physical_inspect_date,icat.ITEM_INSPECTED "

    condDataSet = PassDataSet("DBMA", query)

    Dim foundRow() As DataRow
    Dim projno As String

    'Finding row for Physical condition Exterior Items
    projno = "project_num='" & Txtprojno.Text & "'"
    foundRow = condDataSet.Tables(0).Select(projno)
    For i = 0 To foundRow.GetUpperBound(0)

    If foundRow(i)("ITEM_INSPECTED") = "1" Then
    If Not IsDBNull(foundRow(i)("DEFICIENCY_CODE")) Then
    Ddl_fdwl_cm.SelectedValue = foundRow(i)("DEFICIENCY_CODE")
    End If
    If Not IsDBNull(foundRow(i)("LIFE_SAFETY")) Then
    Txt_fdwl_exig.Text = foundRow(i)("LIFE_SAFETY")
    End If
    If Not IsDBNull(foundRow(i)("ON_PRIOR_REP")) Then
    Ddl_fdwl_opr.SelectedValue = foundRow(i)("ON_PRIOR_REP")
    End If
    If Not IsDBNull(foundRow(i)("REPAIR_TIME")) Then
    Ntimeframe_fdwl.Text = foundRow(i)("REPAIR_TIME")
    End If
    End If

    Friday, May 18, 2018 2:04 PM
  • User-1134632663 posted

    Check the connection string of your  application and stored procedure along with database object . I think some mismatch with database object name and its related properties.

    Also check yellow highlighted code for condition for these dropdown list....

    If foundRow(i)("ITEM_INSPECTED") = "1" Then
    If Not IsDBNull(foundRow(i)("DEFICIENCY_CODE")) Then
    Ddl_fdwl_cm.SelectedValue = foundRow(i)("DEFICIENCY_CODE")
    End If
    If Not IsDBNull(foundRow(i)("LIFE_SAFETY")) Then
    Txt_fdwl_exig.Text = foundRow(i)("LIFE_SAFETY")
    End If
    If Not IsDBNull(foundRow(i)("ON_PRIOR_REP")) Then
    Ddl_fdwl_opr.SelectedValue = foundRow(i)("ON_PRIOR_REP")
    End If
    If Not IsDBNull(foundRow(i)("REPAIR_TIME")) Then
    Ntimeframe_fdwl.Text = foundRow(i)("REPAIR_TIME")
    End If
    End If

    Friday, May 18, 2018 5:42 PM