大家帮我看看哪错了,vs显示from附近错误。
c#吧
全部回复
仅看楼主
level 6
122216637 楼主
private void Button_Click_1(object sender, RoutedEventArgs e)
{
string strselect1 = "select * FROM user where username='" + username.Text.Trim() + "' and password='" + password.Text.Trim() + "'";
sqlcon.Open();
OleDbCommand sqlcmd1 = new OleDbCommand(strselect1, sqlcon);
OleDbDataReader dr1 = sqlcmd1.ExecuteReader();
if (dr1.Read())
{
lode.Content = "ok";
}
else
{
lode.Content = "no";
}
sqlcon.Close();
}
2014年11月24日 06点11分 1
level 6
122216637 楼主
我用的是access数据库
2014年11月24日 06点11分 2
level 10
[user]
是不是关键字问题。
2014年11月24日 06点11分 3
哦我试试
2014年11月24日 07点11分
level 11
你不会把这语句放数据库查询一次吗?
2014年11月24日 10点11分 4
level 4
可能变量附近没空隔
2014年11月24日 12点11分 5
1