Here is the formpage. There is no code on the VB page yet.
<%@ Page Language="VB" AutoEventWireup="false"
CodeFile="cascadingDropDownLists.aspx.vb"
Inherits="Test_cascadingDropDownLists" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:SqlDataSource ID="FormDataSource" runat="server" ConnectionString="<%$
ConnectionStrings:Req2ExceedConnectionString6 %>"
DeleteCommand="DELETE FROM [District_Cities] WHERE [tableID] = @tableID"
InsertCommand="INSERT INTO [District_Cities] ([Dist], [City]) VALUES (@Dist,
@City)"
SelectCommand="SELECT [tableID], [Dist], [City] FROM [District_Cities]"
UpdateCommand="UPDATE [District_Cities] SET [Dist] = @Dist, [City] = @City
WHERE [tableID] = @tableID">
<DeleteParameters>
<asp
arameter Name="tableID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp
arameter Name="Dist" Type="String" />
<asp
arameter Name="City" Type="String" />
<asp
arameter Name="tableID" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp
arameter Name="Dist" Type="String" />
<asp
arameter Name="City" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
<asp:FormView ID="FormView1" runat="server" AllowPaging="True"
DataKeyNames="tableID"
DataSourceID="FormDataSource" DefaultMode="Insert" Height="160px"
Width="408px">
<EditItemTemplate>
tableID:
<asp:Label ID="tableIDLabel1" runat="server" Text='<%# Eval("tableID")
%>'></asp:Label><br />
Dist:
<asp:TextBox ID="DistTextBox" runat="server" Text='<%# Bind("Dist") %>'>
</asp:TextBox><br />
City:
<asp:TextBox ID="CityTextBox" runat="server" Text='<%# Bind("City") %>'>
</asp:TextBox><br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True"
CommandName="Update"
Text="Update">
</asp:LinkButton>
<asp:LinkButton ID="UpdateCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel"
Text="Cancel">
</asp:LinkButton>
</EditItemTemplate>
<InsertItemTemplate>
Dist:
<asp
ropDownList ID="DropDownList1" runat="server"
DataSourceID="DDL_District" DataTextField="DISTRICT"
DataValueField="DIST"
OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"
SelectedValue='<%# Bind("Dist") %>'>
</asp
ropDownList><asp:SqlDataSource ID="DDL_District" runat="server"
ConnectionString="<%$ ConnectionStrings:Req2ExceedConnectionString6 %>"
SelectCommand="SELECT DISTINCT [DISTRICT], [DIST] FROM
[Cities]"></asp:SqlDataSource>
<br />
City:
<asp
ropDownList ID="DropDownList2" runat="server" DataSourceID="DDL_City"
DataTextField="DUTY_STAT"
DataValueField="DUTY_STAT" SelectedValue='<%# Bind("City") %>'>
</asp
ropDownList><asp:SqlDataSource ID="DDL_City" runat="server"
ConnectionString="<%$ ConnectionStrings:Req2ExceedConnectionString6 %>"
SelectCommand="SELECT [DUTY_STAT], [ID] FROM [Cities] WHERE ([DIST] =
@DIST)">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" Name="DIST"
PropertyName="SelectedValue"
Type="String" />
</SelectParameters>
</asp:SqlDataSource>
<br />
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True"
CommandName="Insert"
Text="Insert"></asp:LinkButton>
<asp:LinkButton ID="InsertCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel"
Text="Cancel"></asp:LinkButton>
</InsertItemTemplate>
<ItemTemplate>
tableID:
<asp:Label ID="tableIDLabel" runat="server" Text='<%# Eval("tableID")
%>'></asp:Label><br />
Dist:
<asp:Label ID="DistLabel" runat="server" Text='<%# Bind("Dist")
%>'></asp:Label><br />
City:
<asp:Label ID="CityLabel" runat="server" Text='<%# Bind("City")
%>'></asp:Label><br />
<asp:LinkButton ID="EditButton" runat="server" CausesValidation="False"
CommandName="Edit"
Text="Edit"></asp:LinkButton>
<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False"
CommandName="Delete"
Text="Delete"></asp:LinkButton>
<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False"
CommandName="New"
Text="New"></asp:LinkButton>
</ItemTemplate>
</asp:FormView>
</form>
</body>
</html>