查看: 3409|回复: 3

[求代码] 求帮助

[复制链接]
呵呵哒 发表于 2014-12-18 10:11:54 | 显示全部楼层 |阅读模式
本帖最后由 呵呵哒 于 2014-12-18 10:14 编辑

直接调试出现的问题

直接调试出现的问题

逐步调试出现的问题

逐步调试出现的问题
这行代码,我同学用的没问题,我自己做就运行错误咯
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;


public partial class change_password : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{


}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect("login-movie.aspx");
}
protected void Button1_Click(object sender, EventArgs e)
{
string str = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("cinema.mdb");
OleDbConnection con = new OleDbConnection(str);
con.Open();
OleDbCommand comm = new OleDbCommand("select * from yonghu where Id = '" + TextBox1.Text + " '", con);
OleDbDataReader c = comm.ExecuteReader();
if (!c.Read())
{


Label5.Visible = true;
Label5.Text = "没有此用户!";
c.Close();




return;
}






OleDbCommand com = new OleDbCommand("select Password from yonghu where Id = '" + TextBox1.Text + " '", con);


String ha = com.ExecuteScalar().ToString();




if (TextBox2.Text != ha)
{
//Label6.Visible = true;
Label5.Text = "用户名与初始密码不相符!";
}
if (TextBox2.Text == ha)
{
//Label6.Visible = false;
OleDbCommand comn = new OleDbCommand("update yonghu set Password = '" + TextBox4.Text + "' where Id = '" + TextBox1.Text + " '", con);
comn.CommandText = "update yonghu set Password = '" + TextBox4.Text + "' where Id = '" + TextBox1.Text + " '";



comn.Connection = con;
comn.ExecuteNonQuery();


con.Close();
Label7.Visible = true;


}
}
}

一旦运行就会出错,如图所示
ttasp 发表于 2014-12-18 10:21:22 | 显示全部楼层
你打包传文件给我们吧!我们给你研究下!
 楼主| 呵呵哒 发表于 2014-12-18 13:17:59 | 显示全部楼层
ASP课程作业.zip (39.13 KB, 下载次数: 141) 回复 2# ttasp
ttasp 发表于 2014-12-18 17:04:12 | 显示全部楼层
回复 3# 呵呵哒


    发你咯 看看!

ASP课程作业__TTASP版.rar

34.45 KB, 下载次数: 0, 下载积分: 威望 1 个

售价: 6 个ASP币  [记录]  [购买]

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表

在线客服

售前咨询
售后咨询
服务热线
023-58418553
微信公众号