ASP链接SQL的简单登陆界面 - .NET技术 / ASP.NET
protected void btnLogin_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection("Server = (local);user id = sa;pwd = 1;database = Login");
try
{
conn.Open();
string cmdText = "select username from userinfo where username = '" + this.txtUsername.Text.Trim() + "' and userpassword='" + this.txtPassword.Text.Trim() + "'";
SqlDataAdapter sqlCommon = new SqlDataAdapter(cmdText, conn);
DataSet ds = new DataSet();
sqlCommon.Fill(ds);
if (txtUsername.Text.Trim() == ds.Tables[0].Rows[0][" username"] && txtPassword.Text.Trim() == ds.Tables[0].Rows[0]["userpassword"])
{
conn.Close();
Response.Redirect("Default2.aspx");
}
else
{
lblResults.Visible = true;
lblResults.Text = "用户名或密码错误!";
txtUsername.Text = "";
txtPassword.Text = "";
}
conn.Close();
相关问答:
select top 12 * from Product where [id] not in (select top 12 [id] from Product)
这样可以分页,但是我在后面想加个条件
select top 12 * from Product where [id] not in (select top 12 [id] from Prod ......
我一个项目,有个插入操作,具体是这样的:
我有进货信息表。在出货时选择相应的进货信息,输入数量,选择部门后,点保存按钮,由于网络延时,点一下没有反映,于是用户就又点一下,导致一次插入了两条记录:
例:
......
function CheckOpwd(){//验证用户名
var pwd=document.all.txtOpwd;
var div1=document.getElementById("divPwd");
if (pwd.value=="")
{
......
在asp里怎么调用java写的webservice方法,有很多方法
- <message name="RtPnrIn">
<part name="bstrPnrNO" type="s:string" />
<part name ......
本人不会asp,报错了,请大家帮忙看看。
代码如下:
<%
dim keyword_Name,keyword_YJ,keyword_RQ
if rs("QS_PASS_1_name")<>"0,0" then
keyword_Name=split(rs("QS_ ......