FROM 子句语法错误问题!
程序代码:
错误是“FROM 子句语法错误问题!”错误在第六行!第六行一下的还未运行! OleDbConnection aConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Application.StartupPath + "/" + "DB.mdb"); aConnection.Open();///打开数据库 string SQLString = "select * from user where name='" + textBox1.Text.Trim() + "';";// and password='"+textBox2 .Text .Trim ()+"'";///设置sql 查询语句 OleDbDataAdapter myadapter = new OleDbDataAdapter(SQLString, aConnection); ///创建适配器,执行sql 查询 DataSet ds = new DataSet(); ///建立数据集 myadapter.Fill(ds); ///将查询结果加入 ds 中 if (ds.Tables[0].Rows.Count > 0) ///判断用名密码是否正确 { OleDbDataAdapter qx_adapter = new OleDbDataAdapter("select qx from user where name='" + textBox1.Text.Trim() + "'", aConnection); DataSet ds_qx = new DataSet(); qx_adapter.Fill(ds_qx); qx = Convert.ToInt32(ds_qx.Tables[0].Rows[0]["qx"]);/// textBox4.Text = Convert.ToString(qx); form2_01.Show(); /// form2_01.cdxs(qx); } else { ///MessageBox.Show("你按了确定"); MessageBox.Show("对不起,请输入正确的用户名和密码"); } aConnection.Close();///关闭数据库连接(必须) this.Hide();