stringusername=Session["user"].ToString();stringtype=Session["type"].ToString();stringpwd=Session["pwd"].ToString();stringpassword=TextBox1.Text.ToString();//旧密码string...
string username = Session["user"].ToString();
string type = Session["type"].ToString();
string pwd = Session["pwd"].ToString();
string password = TextBox1.Text.ToString();//旧密码
string newpassword = TextBox2.Text.ToString();//新密码
string newspassword = TextBox3.Text.ToString();//确认密码
//创建连接access数据库的连接字符串
string strConnection = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\My_Web\App_Data\bysj.mdb";
//连接数据库
OleDbConnection objConnection = new OleDbConnection(strConnection);
//打开连接
objConnection.Open();
if (pwd == password)
{
if (newpassword == newspassword)
{
OleDbCommand sqlcmd = new OleDbCommand(@"UPDATE [账号-" + type + "] set password=" + "'" + newpassword + "'"+"where username="+"'"+username+"'", objConnection); //sql语句
Response.Write("");
Response.Write("");
}
else
{
Response.Write("");
}
}
else
{
Response.Write("");
}
objConnection.Close();
为什么这样更改不了数据,也没有报错,求大神帮忙看看,用的是c#
展开