Advertisement

03.20.2008 at 06:27PM PDT, ID: 23258917
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Working with SQLDataSource.

I have two dropdownlist

One with
Country:    DSCountry
Province:   DSRegion
=============================================
Country is populated from a table called:
CREATE TABLE [dbo].[CountryCodes](
      [CountryID] [char](2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
      [Country] [varchar](1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]

However when I choose a country I want the dropdownlist for Region to be properly populated.
This means I have to link the two tables some how? I need a start. Any help would be kindly appreciated.

CREATE TABLE [dbo].[SubCountryCode](
      [CountryID] [char](2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
      [RegionID] [char](2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
      [Region] [varchar](1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
This has to be modified as well:
 
 protected void ddlCountry_SelectedIndexChanged(object sender, EventArgs e)
    {
          if (ddlCountry.SelectedValue == "CA") // Canada, set to provinces.
          {
 
              // Get the DropDownList's SelectedIndex                
              int iRow = ddlCountry.SelectedIndex;
          }
    //    else if (ddlCountry.SelectedValue == "US")
    //    {
    //        DataSet DSStateProvince = new DataSet();
    //        DSStateProvince.ReadXml(Server.MapPath("../xmldata/AccountInformation/States.xml")); //Provinces.xml
    //        ddlStateProvince.DataSource = DSStateProvince;
    //        ddlStateProvince.DataTextField = "name";
    //        ddlStateProvince.DataValueField = "stateid"; // provinceid
    //        ddlStateProvince.DataBind();
    //        // Get the DropDownList's SelectedIndex                
    //        int iRow = ddlCountry.SelectedIndex;
    //    }
    //    else if ((ddlCountry.SelectedValue != "US") && (ddlCountry.SelectedValue != "CA"))
    //    {
    //        ddlStateProvince.Items.Clear();
    //        ddlStateProvince.Items.Insert(0, new ListItem("Not Available", "NA"));
    //      }
 
 
    }
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: mathieu_cupryk
Solution Provided By: l-cm
Participating Experts: 2
Solution Grade: A
Views: 0
Translate:
Loading Advertisement...
03.20.2008 at 06:59PM PDT, ID: 21177583

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 07:00PM PDT, ID: 21177585

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 07:27PM PDT, ID: 21177686

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 07:33PM PDT, ID: 21177709

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 07:34PM PDT, ID: 21177718

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 07:37PM PDT, ID: 21177729

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 07:39PM PDT, ID: 21177737

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 07:39PM PDT, ID: 21177739

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 07:49PM PDT, ID: 21177774

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 07:54PM PDT, ID: 21177789

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 07:56PM PDT, ID: 21177803

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 08:00PM PDT, ID: 21177817

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 08:06PM PDT, ID: 21177845

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 08:06PM PDT, ID: 21177848

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 08:08PM PDT, ID: 21177855

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 08:11PM PDT, ID: 21177870

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 08:17PM PDT, ID: 21177895

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 08:26PM PDT, ID: 21177936

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 08:31PM PDT, ID: 21177955

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 08:33PM PDT, ID: 21177959

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 08:39PM PDT, ID: 21177975

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 08:43PM PDT, ID: 21177992

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 08:48PM PDT, ID: 21178006

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 08:51PM PDT, ID: 21178022

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 08:53PM PDT, ID: 21178025

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 08:57PM PDT, ID: 21178039

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 09:01PM PDT, ID: 21178056

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 09:07PM PDT, ID: 21178073

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 09:08PM PDT, ID: 21178078

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 09:20PM PDT, ID: 21178126

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 09:26PM PDT, ID: 21178147

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 09:31PM PDT, ID: 21178162

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 09:45PM PDT, ID: 21178213

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
03.20.2008 at 06:59PM PDT, ID: 21177583
are you having problems with the SQL or the .Net Code? because the .Net code is fairly simple...

 
03.20.2008 at 07:00PM PDT, ID: 21177585
I having problems with both to get started.
I am not great at this. I need direction.
 
03.20.2008 at 07:27PM PDT, ID: 21177686
first, you need to tell us a bit more as to what you're using... MySQL, or SQLServer?...

second, the code you have there, in the back-end, pretty much does it code-wise... i think your main problem is getting your 2 tables filled with the right data.
 
03.20.2008 at 07:33PM PDT, ID: 21177709

Rank: Master

You this as your dropdownlists.  You shouldn't need to do anything in the code behind since the data will be populated based on the selected value of the first dropdown and the autopostback is set to true.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
<asp:DropDownList ID="ddlCountry" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource2" DataTextField="Country" DataValueField="CountryID">
</asp:DropDownList>
<asp:DropDownList ID="ddlCountryRegion" runat="server" DataSourceID="SqlDataSource1" DataTextField="Region" DataValueField="RegionID">
</asp:DropDownList>
 
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="SELECT [CountryID], [Country] FROM [CountryCodes]">
</asp:SqlDataSource>
 
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="SELECT [RegionID], [Region] FROM [SubCountryCode] WHERE ([CountryID] = @CountryID)">
            <SelectParameters>
                <asp:ControlParameter ControlID="ddlCountry" Name="CountryID" PropertyName="SelectedValue"
                    Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
Open in New Window
 
03.20.2008 at 07:34PM PDT, ID: 21177718
I am using SQL SERVER 2005 with visual studio 2005.
How do I setup my the dropdown for the Region.

I need to populate the Region dropdownlist according to the Country.
Country:    DSCountry
Province:   DSRegion
=============================================
Country is populated from a table called:
CREATE TABLE [dbo].[CountryCodes](
      [CountryID] [char](2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
      [Country] [varchar](1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]

However when I choose a country I want the dropdownlist for Region to be properly populated.
This means I have to link the two tables some how? I need a start. Any help would be kindly appreciated.

CREATE TABLE [dbo].[SubCountryCode](
      [CountryID] [char](2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
      [RegionID] [char](2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
      [Region] [varchar](1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
 
03.20.2008 at 07:37PM PDT, ID: 21177729
This is what I have for country

 Country:</strong></span></strong></span></td>
                        <td colspan="2" style="height: 23px; text-align: left; width: 625px;">
                            <asp:DropDownList ID="ddlCountry" runat="server" DataTextField="Country" DataValueField="CountryID" DataSourceID="DSCountry">
                            </asp:DropDownList><asp:SqlDataSource ID="DSCountry" runat="server" ConnectionString="<%$ ConnectionStrings:omegaloveConnectionString %>"
                                SelectCommand="SELECT [CountryID], [Country] FROM [CountryCodes]"></asp:SqlDataSource>
 
03.20.2008 at 07:39PM PDT, ID: 21177737
cm,
you tell me how I build the other datasource for region. I don;t want to copy and paste.
I want to learn with visual studio 2005 how u did this?
 
03.20.2008 at 07:39PM PDT, ID: 21177739

Rank: Master

Did you try my code?  

If there is no data for in the SubCountryCode for the selected country, there will be no data displayed in the ddlCountryRegion dropdownlist
 
03.20.2008 at 07:49PM PDT, ID: 21177774
Can you tell me how u build this for subcountrycode in visual studio?
 
03.20.2008 at 07:54PM PDT, ID: 21177789

Rank: Master

If you pull the dropdownlist from the toolbox onto the design of the form for the SubCountryCode there is a wizard that will walk you through setting up your data.  Here are the steps.

1) Add dropdownlist to designer
2) Select Choose DataSource from dropdown list task box
3) Select the new datasource option
4) In the "Choose Datasource Type" select database click OK
5) Select New Connection and set up your connectionstring
6) Keep the checkbox selected to add the connectionstring to your web config, select next
7) Now you can specify a procedure or select the data directly from the table
8) If you select the columns from the SubCountryCode and select the "Where..." button
9) This will bring up another dialog that you can select the parameters.  Set the Source: equal to control  and set the ControlID equal to the ddlCountry dropdownlist.  Select Add then OK, then Next
10) Set the field you want to display and the field value.  Select OK

Hope I didn't miss any steps for you.  Let me know if I was too confusing.
 
03.20.2008 at 07:56PM PDT, ID: 21177803

Rank: Master

Don't forget to set the AutoPostBack="True" in the ddlCountry dropdownlist so the parameter for the datasource.of the ddlSubCountryCode will automatically populate.
 
03.20.2008 at 08:00PM PDT, ID: 21177817
I am in query builder
SELECT CountryID, RegionID, Region FROM SubCountryCode
what do I do next.
there is add parameter ...
 
03.20.2008 at 08:06PM PDT, ID: 21177845
Ok cm,
I got it working, however, how do I set the initial value of country to Canada?
 
03.20.2008 at 08:06PM PDT, ID: 21177848

Rank: Master

You need to add a where clause to get all of the region for the specific country code.  In query builder set the filter for the CountryID column to "= @CountryID".

Or you can modify the sql statement directly in the query builder by adding " WHERE ([CountryID] = @CountryID)" to the statement "SELECT [RegionID], [Region] FROM [SubCountryCode]"

SQL Query:
SELECT [RegionID], [Region] FROM [SubCountryCode]
WHERE ([CountryID] = @CountryID)
 
03.20.2008 at 08:08PM PDT, ID: 21177855
This is what I have:
<asp:SqlDataSource ID="DSRegion" runat="server" ConnectionString="<%$ ConnectionStrings:omegaloveConnectionString %>"
                                SelectCommand="SELECT [CountryID], [RegionID], [Region] FROM [SubCountryCode] WHERE ([CountryID] = @CountryID)">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="ddlCountry" Name="CountryID" PropertyName="SelectedValue"
                                        Type="String" />
                                </SelectParameters>
                            </asp:SqlDataSource>
 
03.20.2008 at 08:11PM PDT, ID: 21177870
Now I have to link it to citys
This should be in theory select city from worldcities where
COUNTRYID = @ COUNTRYID
and REGIONID = @ REGIONID
How should i do this?
1:
2:
3:
4:
5:
6:
7:
8:
9:
CREATE TABLE [dbo].[WorldCities](
	[CountryID] [char](2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[City] [varchar](1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[AccentCity] [varchar](1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[RegionID] [char](2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Population] [int] NULL,
	[Latitude] [float] NULL,
	[Longitude] [float] NULL
) ON [PRIMARY]
Open in New Window
 
03.20.2008 at 08:17PM PDT, ID: 21177895

Rank: Master