hi
there, im coming up with a registration form. i can not connect with the database. im using asp.net(visual web developer) and microsoft sql server as database.
in the web.config i came up with these codes;
<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachdbFileName="|DataDirectory|\Courier Management System.mdf";Integrated Security=True"
providerName="System.Data.SqlClient" />
<add name="ConnectionString2" connectionString="Data Source=.\SQLEXPRESS;AttachdbFileName="|DataDirectory|\Courier Management System.mdf";Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
Im not sure if the codes are correct.my server is AIMST-bloytihzp\sqlexpress.master.dbo.
the codes below are the application page:
<%@ Page Title="Untitled Page" Language="VB" MasterPageFile="~/MasterPage.master" %>
<script runat="server">
Protected Sub Registration_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewPageEventArgs)
End Sub
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString2 %>"
InsertCommand="Insert into[Registration] (UserID,Password,RetypePassword,SecretAns,FirstName,LastName,State,PostalCode,Address,city,Email,HNumber)
values (@UserID,@Password,@RetypePassword,@SecretAns,@FirstName,@LastName,State,@PostalCode,@Address,@city,@Email,@HNumber)"></asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString2 %>"></asp:SqlDataSource>
<asp:FormView ID="Registration"
DataSourceID="Connectionstring2" runat="server"
DefaultMode="Insert" Height="692px" Width="1093px"
onpageindexchanging="Registration_PageIndexChanging">
<InsertItemTemplate>
<h2 align="center">SIGN IN FOR A NEW ACCOUNT</h2>
User ID <asp:TextBox ID="TextBox1" runat="server" Text='<%#Bind("UserID") %>'></asp:TextBox>
<br />
<br />
Password
<asp:TextBox ID="TextBox2" runat="server" Text='<%#Bind("Password") %>'></asp:TextBox>
<br />
<br />
Retype Password
<asp:TextBox ID="TextBox3" runat="server" Text='<%#Bind("RetypePassword") %>'></asp:TextBox>
<br />
<br />
Secret Answer
<asp:TextBox ID="TextBox4" runat="server" Text='<%#Bind("SecretAnswer") %>'></asp:TextBox>
<br />
<br />
First Name
<asp:TextBox ID="TextBox5" runat="server" Text='<%#Bind("FirstName") %>'></asp:TextBox>
<br />
<br />
Last Name
<asp:TextBox ID="TextBox6" runat="server" Text='<%#Bind("LastName") %>'></asp:TextBox>
<br />
<br />
State
<asp:TextBox ID="TextBox7" runat="server" Text='<%#Bind("State") %>'></asp:TextBox>
<br />
<br />
Postal Code
<asp:TextBox ID="TextBox8" runat="server" Text='<%#Bind("PostalCode") %>'></asp:TextBox>
<br />
<br />
Address
<asp:TextBox ID="TextBox9" runat="server" Text='<%#Bind("Address") %>'></asp:TextBox>
<br />
<br />
City
<asp:TextBox ID="TextBox10" runat="server" Text='<%#Bind("City") %>'></asp:TextBox>
<br />
<br />
Email Address
<asp:TextBox ID="TextBox11" runat="server" Text='<%#Bind("EmailAdd") %>'></asp:TextBox>
<br />
<br />
H/P Number
<asp:TextBox ID="TextBox12" runat="server" Text='<%#Bind("HNumber") %>'></asp:TextBox>
<br />
<br />
<br />
<asp:Button ID="Button1" runat="server" Text="Submit" Width="106px" />
<asp:Button ID="Button2" runat="server" Text="Clear" Width="106px" />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
</InsertItemTemplate>
</asp:FormView>
</asp:Content>
please help....