qq_43412960 2019-06-09 19:27 采纳率: 78.6%
浏览 168
已采纳

这是一个关于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");
        }
    }
}






















    ![图片说明](https://img-ask.csdn.net/upload/201906/09/1560079594_828565.png)

这个问题怎么解决,F:\网络编程.s3db是sqllite数据库路径

  • 写回答

1条回答 默认 最新

  • threenewbee 2019-06-09 20:24
    关注
    目测 F:\\ 中的那个冒号,你写成全角的了。注意比较
    : (半角)
    和
    : (全角)
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器