public partial class Login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void BtnLogin_Click(object sender, EventArgs e)
{
if (Session["User"] == null)
{
string connectionstr ="Data Source=F:\\网络编程.s3db";
SQLiteConnection connection = new SQLiteConnection(connectionstr);
connection.Open();
SQLiteCommand command = new SQLiteCommand();
command.Connection = connection;
command.CommandText = String.Format(
"select count(*) from login where user='{0}' and password='{1}'",
this.TxtUsername.Text, this.TxtPassword.Text);
int count = (int)command.ExecuteScalar();
if (count > 0) //数据库查询用户
{
Session["User"] = this.TxtUsername.Text.ToString();
Response.Redirect("bug.aspx");
Response.Write("<script language=javascript>登录成功</script>");
}
else
Response.Write("<script language=javascript>账号或者密码错误</script>");
connection.Close();
}
else
{
Application["count"] = Convert.ToInt32(Application["count"]) + 1;
Response.Redirect("BuyCellphone.aspx");
}
}
}
![图片说明](https://img-ask.csdn.net/upload/201906/09/1560079594_828565.png)
这个问题怎么解决,F:\网络编程.s3db是sqllite数据库路径