这是一个关于SQLLITE的问题
问题描述:
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");
}
}
}

这个问题怎么解决,F:\网络编程.s3db是sqllite数据库路径
答
目测 F:\\ 中的那个冒号,你写成全角的了。注意比较
: (半角)
和
: (全角)