.net sql 语言出错
voidenter(objectsender,EventArgse){OleDbConnectionconn=newOleDbConnection();conn.Conn...
void enter (object sender ,EventArgs e)
{
OleDbConnection conn=new OleDbConnection();
conn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+
Server.MapPath ("mydata.mdb");
conn.Open();
string sql;
sql="Insert Into 用户 (id,name,password1,year,month,day) values ('"+id.Text+"','"+name.Text+"','"+password1.Text+"','"+year.Text+"','"+month.Text+"','"+day.Text+"')";
OleDbCommand DBCmd = new OleDbCommand(sql, conn);
DBCmd.ExecuteNonQuery();//新增
conn.Close();
Session["id"] = id.Text;
}
sql出错,用分析器试过,把.text换成字符串,没问题
文档的顶层无效。处理资源 'file:///C:/Documents and Settings/bianjing/Local Settings/Temp/VSD1.tmp.XML' 时出错。第 1 行,位置: 1
Insert Into 用户 (id,name,password1,year,month,day) values ('bianjing0731@yaho,com.cn','阿','a','1','1','1')
^
转化为xml文件 展开
{
OleDbConnection conn=new OleDbConnection();
conn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+
Server.MapPath ("mydata.mdb");
conn.Open();
string sql;
sql="Insert Into 用户 (id,name,password1,year,month,day) values ('"+id.Text+"','"+name.Text+"','"+password1.Text+"','"+year.Text+"','"+month.Text+"','"+day.Text+"')";
OleDbCommand DBCmd = new OleDbCommand(sql, conn);
DBCmd.ExecuteNonQuery();//新增
conn.Close();
Session["id"] = id.Text;
}
sql出错,用分析器试过,把.text换成字符串,没问题
文档的顶层无效。处理资源 'file:///C:/Documents and Settings/bianjing/Local Settings/Temp/VSD1.tmp.XML' 时出错。第 1 行,位置: 1
Insert Into 用户 (id,name,password1,year,month,day) values ('bianjing0731@yaho,com.cn','阿','a','1','1','1')
^
转化为xml文件 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询