Hi mates,
I am building a website using ASP.NET in dreamweaver CS3. I have created an insert page form but when I click the submit button, nothing is happening in the database. What I want is to store the new record in the database. I have created the databse in Access. This ia the code:<MM:Insert
runat="server"
CommandText='<%# "INSERT INTO partner (Address, City, Comments, Email, Firstname, Lastname, Phone) VALUES (?, ?, ?, ?, ?, ?, ?)" %>'
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_mapyconnect") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_mapyconnect") %>'
Expression='<%# Request.Form("MM_insert") = "form1" %>'
CreateDataSet="false"
SuccessURL='<%# "partnerform2.asp" %>'
Debug="true"
>
<Parameters>
<Parameter Name="@Address" Value='<%# IIf((Request.Form("Address") <> Nothing), Request.Form("Address"), "") %>' Type="WChar" />
<Parameter Name="@City" Value='<%# IIf((Request.Form("City") <> Nothing), Request.Form("City"), "") %>' Type="WChar" />
<Parameter Name="@Comments" Value='<%# IIf((Request.Form("Comments") <> Nothing), Request.Form("Comments"), "") %>' Type="WChar" />
<Parameter Name="@Email" Value='<%# IIf((Request.Form("Email") <> Nothing), Request.Form("Email"), "") %>' Type="WChar" />
<Parameter Name="@Firstname" Value='<%# IIf((Request.Form("Firstname") <> Nothing), Request.Form("Firstname"), "") %>' Type="WChar" />
<Parameter Name="@Lastname" Value='<%# IIf((Request.Form("Lastname") <> Nothing), Request.Form("Lastname"), "") %>' Type="WChar" />
<Parameter Name="@Phone" Value='<%# IIf((Request.Form("Phone") <> Nothing), Request.Form("Phone"), "") %>' Type="WChar" />
</Parameters>
</MM:Insert>
<MM:DataSet
id="DataSet1"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_mapyconnect") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_mapyconnect") %>'
CommandText='<%# "SELECT partner.PartnerId, partner.Firstname, partner.Lastname, partner.Address, partner.City, partner.Email, partner.Phone, partner.Comments FROM partner ORDER BY partner.Lastname" %>'
Debug="true"
></MM:DataSet>
<MM:PageBind runat="server" PostBackBind="true" />
What are the missing codes? Please help!
Thanks
| Forum legend: | |
| Locked thread | |
| Moderator | |
![]() |
CNET staff |
![]() |
Samsung staff |
| Norton Authorized Support team | |
| AVG staff | |
| Windows Outreach team | |
![]() |
Dell staff |
| Intel staff | |