Version: 2008
Advanced Search
advertisement
advertisement

Forum display:

Web design & hosting: Need code to store new record.

by ygk1ect - 7/9/09 10:48 AM
Post 1 of 1

Need code to store new record.

by ygk1ect - 7/9/09 10:48 AM

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 Locked thread
Moderator Moderator
CNET staff CNET staff
Samsung staff Samsung staff
Norton Authorized Support team Norton Authorized Support team
AVG staff AVG staff
Windows Outreach team Windows Outreach team
Dell staff Dell staff
Intel staff Intel staff
Powered by Jive Software