求:access数据库+注册框代码提交到数据库中
前台页面我搞好, 求个后台代码, 只要把注册信息提交到数据库中就可以了
login.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="login.aspx.cs" Inherits="users_login" %>
<!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 id="Head1" runat="server">
<title>用户端验证注册</title>
<script language="javascript" type="text/javascript">
function checksubmit()
{
var username=document.all("txtname").value
var userpwd1=document.all("txtpassword1").value
var userpwd2=document.all("txtpassword2").value
// var question=document.all("drquestion").value
// var answer = document.all("txtanswer").value
var qqname = document.all("txtqq").value
var email = document.all("txtemail").value
var zhenshi = document.all("txtzhenshil").value
var guhua = document.all("txtguhua").value
var addrees = document.all("txtaddrees").value
var Mobile = document.all("txtMobile").value
// var identity = document.all("txtid").value
if(username=="")
{
alert("用户名不能为空!")
return false
}
if(userpwd1=="")
{
alert("密码不能为空!")
return false
}
if(userpwd1!=userpwd2)
{
alert("两次输入的密码不一致,请重新输入!")
return false
}
if (qqname == "")
{
alert("QQ不能为空!")
return false
}
patten=/\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/
if(email==""||!patten.exec(email))
{
alert("email地址不正确!")
return false
}
if (zhenshi == "") {
alert("真实姓名不能为空!")
return false
}
if (addrees == "") {
alert("地址不能为空!")
return false
}
if (Mobile == "") {
alert("手机号码不能为空!")
return false
}
return true
}
</script>
</head>
<body>
<form id="form1" runat="server" method="post" onsubmit="return checksubmit()">
<table style="width: 384px; height: 340px; border-right: lavender thin double; border-top: lavender thin double; border-left: lavender thin double; border-bottom: lavender thin double;" border="0" align="center">
<tr>
<td align="center" bgcolor="#99ccff" colspan="2">
用户注册</td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="lblmessage" runat="server" Width="310px" ForeColor="Red"></asp:Label></td>
</tr>
<tr>
<td style="width: 122px" align="right">
用户名:</td>
<td style="width: 118px; color: red">
<asp:TextBox ID="txtname" runat="server" Width="146px"></asp:TextBox>*</td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size:5px">
--------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
<tr>
<td style="width: 122px; height: 27px" align="right">
密码:</td>
<td style="width: 118px; color: red; height: 27px">
<asp:TextBox ID="txtpassword1" runat="server" TextMode="Password" Width="147px"></asp:TextBox>*</td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size:5px">
--------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
<tr>
<td style="width: 122px; height: 28px;" align="right">
确认密码:</td>
<td style="width: 118px; color: red; height: 28px;">
<asp:TextBox ID="txtpassword2" runat="server" TextMode="Password" Width="147px"></asp:TextBox>*</td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size:5px">
--------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
<tr>
<td style="width: 122px" align="right">
qq号:</td>
<td style="width: 118px; height: 21px; color: red;">
<asp:TextBox ID="txtqq" runat="server" Width="146px"></asp:TextBox>*</td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size:5px">
--------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
<tr>
<td style="width: 122px; height: 21px" align="right">
邮箱:</td>
<td style="width: 118px; height: 21px; color: red;">
<asp:TextBox ID="txtemail" runat="server" Width="146px"></asp:TextBox>*</td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size:5px">
--------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
<tr>
<td style="width: 122px" align="right">
性别:</td>
<td style="width: 118px">
<asp:DropDownList ID="Drsex" runat="server" Width="48px">
<asp:ListItem>男</asp:ListItem>
<asp:ListItem>女</asp:ListItem>
</asp:DropDownList></td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size:5px">
--------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
<tr>
<td style="width: 122px" align="right">
姓名:</td>
<td style="width: 118px; height: 21px; color: red;">
<asp:TextBox ID="txtzhenshil" runat="server" Width="146px"></asp:TextBox>*</td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size:5px">
--------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
<tr>
<td align="right" style="width: 122px">
固话:</td>
<td style="width: 118px; height: 21px; color: red;">
<asp:TextBox ID="txtguhua" runat="server" Width="146px"></asp:TextBox></td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size:5px">
--------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
<tr>
<td style="width: 122px" align="right">
地址:</td>
<td style="width: 118px; height: 21px; color: red;">
<asp:TextBox ID="txtaddrees" runat="server" Width="146px"></asp:TextBox>*</td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size:5px">
--------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
<tr>
<td style="width: 122px" align="right">
手机号码:</td>
<td style="width: 118px; height: 21px; color: red;">
<asp:TextBox ID="txtMobile" runat="server" Width="146px"></asp:TextBox>*
</td>
</tr>
<tr>
<td style="text-align: center;" align="right" colspan="2">
</td>
</tr>
<tr>
<td align="center" colspan="2" style="height: 26px">
<input type="reset" name="button" id="button" value="重置" />
<asp:Button ID="Button1"
runat="server" Text="提交" onclick="Button1_Click1" />
</td>
</tr>
</table>
</form>
</body>
</html>
后台代码:
求个后台代码, 只要把注册信息提交到数据库中就可以了,asp.net新人,望大家指点谢谢
login.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="login.aspx.cs" Inherits="users_login" %>
<!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 id="Head1" runat="server">
<title>用户端验证注册</title>
<script language="javascript" type="text/javascript">
function checksubmit()
{
var username=document.all("txtname").value
var userpwd1=document.all("txtpassword1").value
var userpwd2=document.all("txtpassword2").value
// var question=document.all("drquestion").value
// var answer = document.all("txtanswer").value
var qqname = document.all("txtqq").value
var email = document.all("txtemail").value
var zhenshi = document.all("txtzhenshil").value
var guhua = document.all("txtguhua").value
var addrees = document.all("txtaddrees").value
var Mobile = document.all("txtMobile").value
// var identity = document.all("txtid").value
if(username=="")
{
alert("用户名不能为空!")
return false
}
if(userpwd1=="")
{
alert("密码不能为空!")
return false
}
if(userpwd1!=userpwd2)
{
alert("两次输入的密码不一致,请重新输入!")
return false
}
if (qqname == "")
{
alert("QQ不能为空!")
return false
}
patten=/\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/
if(email==""||!patten.exec(email))
{
alert("email地址不正确!")
return false
}
if (zhenshi == "") {
alert("真实姓名不能为空!")
return false
}
if (addrees == "") {
alert("地址不能为空!")
return false
}
if (Mobile == "") {
alert("手机号码不能为空!")
return false
}
return true
}
</script>
</head>
<body>
<form id="form1" runat="server" method="post" onsubmit="return checksubmit()">
<table style="width: 384px; height: 340px; border-right: lavender thin double; border-top: lavender thin double; border-left: lavender thin double; border-bottom: lavender thin double;" border="0" align="center">
<tr>
<td align="center" bgcolor="#99ccff" colspan="2">
用户注册</td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="lblmessage" runat="server" Width="310px" ForeColor="Red"></asp:Label></td>
</tr>
<tr>
<td style="width: 122px" align="right">
用户名:</td>
<td style="width: 118px; color: red">
<asp:TextBox ID="txtname" runat="server" Width="146px"></asp:TextBox>*</td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size:5px">
--------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
<tr>
<td style="width: 122px; height: 27px" align="right">
密码:</td>
<td style="width: 118px; color: red; height: 27px">
<asp:TextBox ID="txtpassword1" runat="server" TextMode="Password" Width="147px"></asp:TextBox>*</td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size:5px">
--------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
<tr>
<td style="width: 122px; height: 28px;" align="right">
确认密码:</td>
<td style="width: 118px; color: red; height: 28px;">
<asp:TextBox ID="txtpassword2" runat="server" TextMode="Password" Width="147px"></asp:TextBox>*</td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size:5px">
--------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
<tr>
<td style="width: 122px" align="right">
qq号:</td>
<td style="width: 118px; height: 21px; color: red;">
<asp:TextBox ID="txtqq" runat="server" Width="146px"></asp:TextBox>*</td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size:5px">
--------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
<tr>
<td style="width: 122px; height: 21px" align="right">
邮箱:</td>
<td style="width: 118px; height: 21px; color: red;">
<asp:TextBox ID="txtemail" runat="server" Width="146px"></asp:TextBox>*</td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size:5px">
--------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
<tr>
<td style="width: 122px" align="right">
性别:</td>
<td style="width: 118px">
<asp:DropDownList ID="Drsex" runat="server" Width="48px">
<asp:ListItem>男</asp:ListItem>
<asp:ListItem>女</asp:ListItem>
</asp:DropDownList></td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size:5px">
--------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
<tr>
<td style="width: 122px" align="right">
姓名:</td>
<td style="width: 118px; height: 21px; color: red;">
<asp:TextBox ID="txtzhenshil" runat="server" Width="146px"></asp:TextBox>*</td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size:5px">
--------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
<tr>
<td align="right" style="width: 122px">
固话:</td>
<td style="width: 118px; height: 21px; color: red;">
<asp:TextBox ID="txtguhua" runat="server" Width="146px"></asp:TextBox></td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size:5px">
--------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
<tr>
<td style="width: 122px" align="right">
地址:</td>
<td style="width: 118px; height: 21px; color: red;">
<asp:TextBox ID="txtaddrees" runat="server" Width="146px"></asp:TextBox>*</td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size:5px">
--------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
<tr>
<td style="width: 122px" align="right">
手机号码:</td>
<td style="width: 118px; height: 21px; color: red;">
<asp:TextBox ID="txtMobile" runat="server" Width="146px"></asp:TextBox>*
</td>
</tr>
<tr>
<td style="text-align: center;" align="right" colspan="2">
</td>
</tr>
<tr>
<td align="center" colspan="2" style="height: 26px">
<input type="reset" name="button" id="button" value="重置" />
<asp:Button ID="Button1"
runat="server" Text="提交" onclick="Button1_Click1" />
</td>
</tr>
</table>
</form>
</body>
</html>
后台代码:
求个后台代码, 只要把注册信息提交到数据库中就可以了,asp.net新人,望大家指点谢谢
...全文
相关推荐
Microsoft Access Database Engine 2007.zip
可解决sqlserver 未在本地计算机上注册“Microsoft.ACE.OLEDB.12.0”提供程序
Office 2016 Access DataBase Engine 64位
未在本地计算机上注册“Microsoft.Jet.OLEDB.4.0”提供程序。需要下载此资源。 个人是在研究别人代码的时候,遇到这个问题,找的资源。
Microsoft Office Access database engine 2007 Chinese simplified
Excel文件导入SQL Server 2012 时出现 “未在本地计算机上注册’microsoft.ACE.oledb.12.0‘ ”错误,安装此插件即可
jsp连接access数据库(注册页面)详细代码
连接数据库的代码,注册时的连接!!是txt文档
Access数据库引擎,无需安装Access也可以使用Access数据库AccessDatabaseEngine.rar
Access数据库引擎,无需安装Access也可以使用Access数据库AccessDatabaseEngine.rar


