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. Visual Basic
  4. help for atlas: cascading drop down from database?

help for atlas: cascading drop down from database?

Scheduled Pinned Locked Moved Visual Basic
tutorialquestioncsharpc++asp-net
3 Posts 1 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.
  • I Offline
    I Offline
    ii_noname_ii
    wrote on last edited by
    #1

    Hello, making progress in trying to get atlas working...But not quite there yet... To populate the dropdownlists from a database: Public Function populateProjectDDL() Dim knownCategoryValues As String Dim category As String (...) (Filled my dataset called ds1.) For Each datarowitem As DataRow In ds1.Tables(0).Rows ?!?!?!?! Next return ?!?!?! end function What do I return, how do i fill the whatever i return? (http://atlas.asp.net/atlastoolkit/Walkthrough/CCDWithDB.aspx[^] was trying to follow that example but they lost me in the c++) Please help me? (asp.net forum mods won't let my posts appear)

    I 1 Reply Last reply
    0
    • I ii_noname_ii

      Hello, making progress in trying to get atlas working...But not quite there yet... To populate the dropdownlists from a database: Public Function populateProjectDDL() Dim knownCategoryValues As String Dim category As String (...) (Filled my dataset called ds1.) For Each datarowitem As DataRow In ds1.Tables(0).Rows ?!?!?!?! Next return ?!?!?! end function What do I return, how do i fill the whatever i return? (http://atlas.asp.net/atlastoolkit/Walkthrough/CCDWithDB.aspx[^] was trying to follow that example but they lost me in the c++) Please help me? (asp.net forum mods won't let my posts appear)

      I Offline
      I Offline
      ii_noname_ii
      wrote on last edited by
      #2

      Made progress...: _ Public Function populateProjectDDL(ByVal knownCategoryValues As String, ByVal category As String) As CascadingDropDownNameValue() 'Dim knownCategoryValues As String 'Dim category As String 'Which projects to show: If Session("admin") = 1 Then ds1 = dbComponent1.selectOneCondition("Project", "active", 1) 'info1.InnerText = "As admin, you see inactive projects, wells, sections and Drilling units as well." Else Dim querystr = "SELECT DISTINCT P.project_id, P.project_name FROM Project as P, UserRole as UR WHERE " querystr = querystr + "UR.user_id = " & Session("active_user") & " AND " querystr = querystr + "UR.project_id = P.project_id AND " querystr = querystr + "P.active = 1" ds1 = dbComponent1.query(querystr) End If Dim objTable As System.Data.DataTable objTable = ds1.Tables(0) If ds1.Tables(0).Rows.Count > 0 Then 'user cannot set defaults With objTable Dim intRow As Integer Dim values As List(Of CascadingDropDownNameValue) = New List(Of CascadingDropDownNameValue) For intRow = 0 To .Rows.Count - 1 values.Add(New CascadingDropDownNameValue(.Rows(intRow).Item("project_name").ToString, .Rows(intRow).Item("project_id"))) Next Return values.ToArray End With Return New CascadingDropDownNameValue() {} 'Return knownCategoryValues 'Return category Else Return Nothing End If ds1.Clear() End Function Now [method error 500] in the project drop down...

      I 1 Reply Last reply
      0
      • I ii_noname_ii

        Made progress...: _ Public Function populateProjectDDL(ByVal knownCategoryValues As String, ByVal category As String) As CascadingDropDownNameValue() 'Dim knownCategoryValues As String 'Dim category As String 'Which projects to show: If Session("admin") = 1 Then ds1 = dbComponent1.selectOneCondition("Project", "active", 1) 'info1.InnerText = "As admin, you see inactive projects, wells, sections and Drilling units as well." Else Dim querystr = "SELECT DISTINCT P.project_id, P.project_name FROM Project as P, UserRole as UR WHERE " querystr = querystr + "UR.user_id = " & Session("active_user") & " AND " querystr = querystr + "UR.project_id = P.project_id AND " querystr = querystr + "P.active = 1" ds1 = dbComponent1.query(querystr) End If Dim objTable As System.Data.DataTable objTable = ds1.Tables(0) If ds1.Tables(0).Rows.Count > 0 Then 'user cannot set defaults With objTable Dim intRow As Integer Dim values As List(Of CascadingDropDownNameValue) = New List(Of CascadingDropDownNameValue) For intRow = 0 To .Rows.Count - 1 values.Add(New CascadingDropDownNameValue(.Rows(intRow).Item("project_name").ToString, .Rows(intRow).Item("project_id"))) Next Return values.ToArray End With Return New CascadingDropDownNameValue() {} 'Return knownCategoryValues 'Return category Else Return Nothing End If ds1.Clear() End Function Now [method error 500] in the project drop down...

        I Offline
        I Offline
        ii_noname_ii
        wrote on last edited by
        #3

        Solved: Solution: include the populate of first drop down in aspx page, don't specify a servicepath for the first one, like this: <WebMethod()> _ Public Function populateProjectDDLPageMethod(ByVal knownCategoryValues As String, ByVal category As String) As AtlasControlToolkit.CascadingDropDownNameValue() (...) </x-turndown>

        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