We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,459 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Generate second drop down list from first all from database

Hi there, i got stuck with this problem!!!

I have 2 drop down list, the first one come from the table "categorie" and till here no problem, the proble is that i would like to generate the second drop down list , which come from the table "subcategorie" beacause of what we have choose in the first one!!

thanks for your help!!

2
Contributors
1
Reply
1 Day
Discussion Span
1 Year Ago
Last Updated
2
Views
grafic.web
Newbie Poster
9 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

I need help with this as well... here's my code for the data sources:

<asp:SqlDataSource ID="SystemDataSource" runat="server"
        ConnectionString="server=fafsv-mysql.gsa.co.santa-clara.ca.us;User Id=root;database=gsais;password=0263;Persist Security Info=True"

        
        SelectCommand="SELECT DISTINCT [SystemName] FROM [blsys_systems]" 
        ProviderName="MySql.Data.MySqlClient">
        <SelectParameters>
            <asp:ControlParameter ControlID="SystemDropDown" Name="SystemName"
                PropertyName="SelectedValue" />
        </SelectParameters>
    </asp:SqlDataSource>

    <asp:SqlDataSource ID="LocationDataSource" runat="server"
        ConnectionString="server=fafsv-mysql.gsa.co.santa-clara.ca.us;User Id=root;database=gsais;password=0263;Persist Security Info=True"

        
        SelectCommand="SELECT DISTINCT [SystemName] FROM [blsys_systems] WHERE ([LocationName] = @LocationName)" 
        ProviderName="MySql.Data.MySqlClient">
        <SelectParameters>
            <asp:ControlParameter ControlID="SystemDropDown" Name="SystemName"
                PropertyName="SelectedValue" />
        </SelectParameters>
    </asp:SqlDataSource>

and for the VB part:

Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
        SystemDropDown.SelectedValue = Request.QueryString("SystemName")
        LocationDropDown.SelectedValue = Request.QueryString("LocationName")
    End Sub
JustineAubrey
Newbie Poster
7 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.3192 seconds using 2.72MB