How do I insert a record using Wizard?

J

Jim

Using VSE 2008 and VB, I created a page with a Wizard on it and put in all
the steps with the required informaiton. But, I can't figure out how to
make the "Finish" button in the Wizard insert the record. Can someine show
me how to do this? Below is my aspx page. Thank you!

<%@ Page Language="VB" MasterPageFile="~/site.master"
AutoEventWireup="false"
CodeFile="ProducerAdd.aspx.vb" Inherits="Admin_ProducerAdd"
Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContent"
runat="Server">
<br />
<asp:Wizard ID="WizardAddProducer" runat="server" ActiveStepIndex="8"
CancelDestinationPageUrl="~/Admin/ProducerAdd.aspx"
DisplayCancelButton="True"
FinishDestinationPageUrl="~/Admin/Producer.aspx">
<WizardSteps>
<asp:WizardStep runat="server" Title="Local">
Country:
<asp:DropDownList ID="DLCountry" runat="server"
AutoPostBack="True" DataSourceID="sqlCountry"
DataTextField="CountryName" DataValueField="CountryID">
</asp:DropDownList>
<br />
State:
<asp:DropDownList ID="DLState" runat="server"
AutoPostBack="True" DataSourceID="sqlStates"
DataTextField="StateName" DataValueField="StateID">
</asp:DropDownList>
<br />
City:
<asp:DropDownList ID="DLCity" runat="server"
DataSourceID="sqlCity" DataTextField="CityName"
DataValueField="CityID">
</asp:DropDownList>
<br />
</asp:WizardStep>
<asp:WizardStep runat="server" Title="Region">
Procucer Type:
<asp:DropDownList ID="DropDownListType" runat="server"
DataSourceID="sqlProducerType"
DataTextField="TypeName" DataValueField="TypeID">
</asp:DropDownList>
<br />
Region:
<asp:DropDownList ID="DropDownListRegion" runat="server"
AutoPostBack="True" DataSourceID="sqlRegion"
DataTextField="RegionName" DataValueField="RegionID">
</asp:DropDownList>
<br />
Sub-Region:
<asp:DropDownList ID="DropDownListSubRegion" runat="server"
DataSourceID="sqlSubRegion"
DataTextField="SubRegionName"
DataValueField="SubRegionID">
</asp:DropDownList>
</asp:WizardStep>
<asp:WizardStep runat="server" Title="Name &amp; Address">
ProducerName:
<asp:TextBox ID="ProducerNameTextBox" runat="server"
Text='<%# Bind("ProducerName") %>' />
<br />
ProducerStreetAddress:
<asp:TextBox ID="ProducerStreetAddressTextBox"
runat="server" Text='<%# Bind("ProducerStreetAddress") %>' />
<br />
ProducerStreetAddress2:
<asp:TextBox ID="ProducerStreetAddress2TextBox"
runat="server" Text='<%# Bind("ProducerStreetAddress2") %>' />
<br />
ProducerZipCode:
<asp:TextBox ID="ProducerZipCodeTextBox" runat="server"
Text='<%# Bind("ProducerZipCode") %>' />
</asp:WizardStep>
<asp:WizardStep ID="WSContact" runat="server" Title="Contact
Info">
ProducerPhone:
<asp:TextBox ID="ProducerPhoneTextBox" runat="server"
Text='<%# Bind("ProducerPhone") %>' />
<br />
ProducerFax:
<asp:TextBox ID="ProducerFaxTextBox" runat="server"
Text='<%# Bind("ProducerFax") %>' />
<br />
ProducerEmail:
<asp:TextBox ID="ProducerEmailTextBox" runat="server"
Text='<%# Bind("ProducerEmail") %>' />
<br />
ProducerURL:
<asp:TextBox ID="ProducerURLTextBox" runat="server"
Text='<%# Bind("ProducerURL") %>' />
<br />
ProducerContactName:
<asp:TextBox ID="ProducerContactNameTextBox" runat="server"
Text='<%# Bind("ProducerContactName") %>' />
</asp:WizardStep>
<asp:WizardStep runat="server" Title="Biography">
Year Founded:<asp:DropDownList ID="DropDownList1"
runat="server"
DataSourceID="sqlYears" DataTextField="Year"
DataValueField="YearID">
</asp:DropDownList>
<br />
&nbsp;ProducerInfo:<br />
&nbsp;<asp:TextBox ID="ProducerInfoTextBox" runat="server"
Text='<%# Bind("ProducerInfo") %>'
Height="182px" TextMode="MultiLine" Width="375px" />
</asp:WizardStep>
<asp:WizardStep runat="server" Title="Tasting">
Tasting ID
<asp:TextBox ID="ProducerTastingIDTextBox" runat="server"
Text='<%# Bind("ProducerTastingID") %>' />
</asp:WizardStep>
<asp:WizardStep runat="server" Title="Restaurant">
ProducerRestaurantID:
<asp:TextBox ID="ProducerRestaurantIDTextBox" runat="server"
Text='<%# Bind("ProducerRestaurantID") %>' />
</asp:WizardStep>
<asp:WizardStep runat="server" Title="Community">
ProducerClubID:
<asp:TextBox ID="ProducerClubIDTextBox" runat="server"
Text='<%# Bind("ProducerClubID") %>' />
<br />
ProducerNewsletterID:
<asp:TextBox ID="ProducerNewsletterIDTextBox" runat="server"
Text='<%# Bind("ProducerNewsletterID") %>' />
</asp:WizardStep>
<asp:WizardStep runat="server" Title="Admin">
ProducerUserId:
<asp:TextBox ID="ProducerUserIdTextBox" runat="server"
Text='<%# Bind("ProducerUserId") %>' />
<br />
ProducerApprovalStatusID:
<asp:TextBox ID="ProducerApprovalStatusIDTextBox"
runat="server" Text='<%# Bind("ProducerApprovalStatusID") %>' />
<br />
ProducerDateAdded:
<asp:TextBox ID="ProducerDateAddedTextBox" runat="server"
Text='<%# Bind("ProducerDateAdded") %>' />
<asp:LinkButton ID="InsertButton" runat="server"
CausesValidation="True" CommandName="Insert"
Text="Insert" />
&nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server"
CausesValidation="False"
CommandName="Cancel" Text="Cancel" />
</asp:WizardStep>
</WizardSteps>
</asp:Wizard>
<hr />
<br />
<asp:Button ID="ButtonCityAdd" runat="server" Text="Add City" />
<br />
<hr />
<asp:SqlDataSource ID="sqlProducerDetails" runat="server"
ConnectionString="<%$ ConnectionStrings:SQLConnectionString %>"
DeleteCommand="DELETE FROM [ZCProducer] WHERE [ProducerID] =
@ProducerID"
InsertCommand="INSERT INTO [ZCProducer] ([ProducerUserId],
[ProducerTypeID], [ProducerRestaurantID], [ProducerClubID],
[ProducerNewsletterID], [ProducerYearID], [ProducerRegionID],
[ProducerSubRegionID], [ProducerTastingID], [ProducerCityID],
[ProducerStateID], [ProducerCountryID], [ProducerApprovalStatusID],
[ProducerName], [ProducerStreetAddress], [ProducerStreetAddress2],
[ProducerZipCode], [ProducerPhone], [ProducerFax], [ProducerEmail],
[ProducerURL], [ProducerContactName], [ProducerInfo], [ProducerDateAdded])
VALUES (@ProducerUserId, @ProducerTypeID, @ProducerRestaurantID,
@ProducerClubID, @ProducerNewsletterID, @ProducerYearID, @ProducerRegionID,
@ProducerSubRegionID, @ProducerTastingID, @ProducerCityID, @ProducerStateID,
@ProducerCountryID, @ProducerApprovalStatusID, @ProducerName,
@ProducerStreetAddress, @ProducerStreetAddress2, @ProducerZipCode,
@ProducerPhone, @ProducerFax, @ProducerEmail, @ProducerURL,
@ProducerContactName, @ProducerInfo, @ProducerDateAdded)"
SelectCommand="SELECT * FROM [ZCProducer]"
UpdateCommand="UPDATE [ZCProducer] SET [ProducerUserId] =
@ProducerUserId, [ProducerTypeID] = @ProducerTypeID, [ProducerRestaurantID]
= @ProducerRestaurantID, [ProducerClubID] = @ProducerClubID,
[ProducerNewsletterID] = @ProducerNewsletterID, [ProducerYearID] =
@ProducerYearID, [ProducerRegionID] = @ProducerRegionID,
[ProducerSubRegionID] = @ProducerSubRegionID, [ProducerTastingID] =
@ProducerTastingID, [ProducerCityID] = @ProducerCityID, [ProducerStateID] =
@ProducerStateID, [ProducerCountryID] = @ProducerCountryID,
[ProducerApprovalStatusID] = @ProducerApprovalStatusID, [ProducerName] =
@ProducerName, [ProducerStreetAddress] = @ProducerStreetAddress,
[ProducerStreetAddress2] = @ProducerStreetAddress2, [ProducerZipCode] =
@ProducerZipCode, [ProducerPhone] = @ProducerPhone, [ProducerFax] =
@ProducerFax, [ProducerEmail] = @ProducerEmail, [ProducerURL] =
@ProducerURL, [ProducerContactName] = @ProducerContactName, [ProducerInfo] =
@ProducerInfo, [ProducerDateAdded] = @ProducerDateAdded WHERE [ProducerID] =
@ProducerID">
<DeleteParameters>
<asp:parameter Name="ProducerID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:parameter Name="ProducerUserId" Type="String" />
<asp:parameter Name="ProducerTypeID" Type="Int32" />
<asp:parameter Name="ProducerRestaurantID" Type="Int32" />
<asp:parameter Name="ProducerClubID" Type="Int32" />
<asp:parameter Name="ProducerNewsletterID" Type="Int32" />
<asp:parameter Name="ProducerYearID" Type="Int32" />
<asp:parameter Name="ProducerRegionID" Type="Int32" />
<asp:parameter Name="ProducerSubRegionID" Type="Int32" />
<asp:parameter Name="ProducerTastingID" Type="Int32" />
<asp:parameter Name="ProducerCityID" Type="Int32" />
<asp:parameter Name="ProducerStateID" Type="Int32" />
<asp:parameter Name="ProducerCountryID" Type="Int32" />
<asp:parameter Name="ProducerApprovalStatusID" Type="Int32" />
<asp:parameter Name="ProducerName" Type="String" />
<asp:parameter Name="ProducerStreetAddress" Type="String" />
<asp:parameter Name="ProducerStreetAddress2" Type="String" />
<asp:parameter Name="ProducerZipCode" Type="String" />
<asp:parameter Name="ProducerPhone" Type="String" />
<asp:parameter Name="ProducerFax" Type="String" />
<asp:parameter Name="ProducerEmail" Type="String" />
<asp:parameter Name="ProducerURL" Type="String" />
<asp:parameter Name="ProducerContactName" Type="String" />
<asp:parameter Name="ProducerInfo" Type="String" />
<asp:parameter Name="ProducerDateAdded" Type="DateTime" />
<asp:parameter Name="ProducerID" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:parameter Name="ProducerUserId" Type="String" />
<asp:parameter Name="ProducerTypeID" Type="Int32" />
<asp:parameter Name="ProducerRestaurantID" Type="Int32" />
<asp:parameter Name="ProducerClubID" Type="Int32" />
<asp:parameter Name="ProducerNewsletterID" Type="Int32" />
<asp:parameter Name="ProducerYearID" Type="Int32" />
<asp:parameter Name="ProducerRegionID" Type="Int32" />
<asp:parameter Name="ProducerSubRegionID" Type="Int32" />
<asp:parameter Name="ProducerTastingID" Type="Int32" />
<asp:parameter Name="ProducerCityID" Type="Int32" />
<asp:parameter Name="ProducerStateID" Type="Int32" />
<asp:parameter Name="ProducerCountryID" Type="Int32" />
<asp:parameter Name="ProducerApprovalStatusID" Type="Int32" />
<asp:parameter Name="ProducerName" Type="String" />
<asp:parameter Name="ProducerStreetAddress" Type="String" />
<asp:parameter Name="ProducerStreetAddress2" Type="String" />
<asp:parameter Name="ProducerZipCode" Type="String" />
<asp:parameter Name="ProducerPhone" Type="String" />
<asp:parameter Name="ProducerFax" Type="String" />
<asp:parameter Name="ProducerEmail" Type="String" />
<asp:parameter Name="ProducerURL" Type="String" />
<asp:parameter Name="ProducerContactName" Type="String" />
<asp:parameter Name="ProducerInfo" Type="String" />
<asp:parameter Name="ProducerDateAdded" Type="DateTime" />
</InsertParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="sqlProducerType" runat="server"
ConnectionString="<%$ ConnectionStrings:SQLConnectionString %>"
SelectCommand="SELECT [TypeID], [TypeName] FROM
[ZCValuesProducerType]"></asp:SqlDataSource>
<asp:SqlDataSource ID="sqlCountry" runat="server" ConnectionString="<%$
ConnectionStrings:SQLConnectionString %>"
SelectCommand="SELECT [CountryID], [CountryName] FROM
[ZCValuesCountry] ORDER BY [CountrySortOne], [CountryName]">
</asp:SqlDataSource>
<asp:SqlDataSource ID="sqlStates" runat="server" ConnectionString="<%$
ConnectionStrings:SQLConnectionString %>"
SelectCommand="SELECT [StateID], [StateName] FROM [ZCValuesStates]
WHERE ([StateCountryID] = @StateCountryID) ORDER BY [StateName]">
<SelectParameters>
<asp:ControlParameter ControlID="WizardAddProducer$DLCountry"
Name="StateCountryID"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="sqlCity" runat="server" ConnectionString="<%$
ConnectionStrings:SQLConnectionString %>"
SelectCommand="SELECT [CityID], [CityName] FROM [ZCValuesCity] WHERE
(([CityStateID] = @CityStateID) AND ([CityCountryID] = @CityCountryID))
ORDER BY [CityName]">
<SelectParameters>
<asp:ControlParameter ControlID="WizardAddProducer$DLState"
Name="CityStateID" PropertyName="SelectedValue"
Type="Int32" />
<asp:ControlParameter ControlID="WizardAddProducer$DLCountry"
Name="CityCountryID"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="sqlYears" runat="server" ConnectionString="<%$
ConnectionStrings:SQLConnectionString %>"
SelectCommand="SELECT [YearID], [Year] FROM
[ZCValuesYear]"></asp:SqlDataSource>

<asp:SqlDataSource ID="sqlRegion" runat="server" ConnectionString="<%$
ConnectionStrings:SQLConnectionString %>"

SelectCommand="SELECT [RegionID], [RegionName] FROM [ZCValuesRegion]
WHERE ([RegionCountryID] = @RegionCountryID) ORDER BY [RegionName]">
<SelectParameters>
<asp:ControlParameter ControlID="WizardAddProducer$DLCountry"
Name="RegionCountryID"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="sqlSubRegion" runat="server"
ConnectionString="<%$ ConnectionStrings:SQLConnectionString %>"
SelectCommand="SELECT [SubRegionID], [SubRegionName] FROM
[ZCValuesSubRegion] WHERE ([SubParentRegionID] = @SubParentRegionID) ORDER
BY [SubRegionName]">
<SelectParameters>
<asp:ControlParameter
ControlID="WizardAddProducer$DropDownListRegion" Name="SubParentRegionID"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
</asp:Content>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,149
Members
46,695
Latest member
StanleyDri

Latest Threads

Top