avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • January 20, 2019, 08:41 AM
  • Proudly celebrating 13 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Help C# ASPX Database/dropdown error  (Read 2042 times)


  • Participant
  • Joined in 2008
  • *
  • Posts: 119
    • View Profile
    • Donate to Member
Help C# ASPX Database/dropdown error
« on: May 18, 2009, 01:39 AM »
I have a drop Download list that is being filled from a database:

My ASPX.cs file
        myDataAdapter.Fill(myDataSet, "country,country_id");

        DropDownList1.DataSource = myDataSet;
        DropDownList1.DataValueField = "country_id";
        DropDownList1.DataTextField = "country";

my APSX File
<asp:ScriptManager ID="ScriptManager1" runat="server">
                                <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
                                    </asp:DropDownList><br /><br />
                                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                        Adderss: label stuff
                                        Adderss: label stuff
                                        trigger stuff

when I select something from the drop down list a access the database again but no matter how many items are in the dropdown I get return a value of 1 from this code
My ASPX.cs file
database stuff
        int place = Convert.ToInt32(DropDownList1.SelectedValue);
        String strSQL = database select using place

Can someone please help me?