Пример #1
0
    /// <summary>
    /// add user to the GoogleApp
    /// </summary>
    /// <param name="username"></param>
    public static void AddUserAccount(string username, string email,string firstname,string lastname, string password)
    {
        using (DbAction db = new DbAction("connStr1"))
        {
            string sql = string.Format("insert into GoogleApp_Users_t(username,email,firstname,lastname,password,createtime) values('{0}','{1}','{2}','{3}','{4}',getdate())", username, email,firstname,lastname, password);

            SqlCommand cmd = new SqlCommand(sql);

            db.ExecuetNonQuery(cmd);
        }
    }
Пример #2
0
    public static void LogsError(string username, string error)
    {
        using (DbAction db = new DbAction("connStr1"))
        {
            string sql = string.Format("insert into GoogleApp_Errors_t(username,error,adddate) values('{0}','{1}',getdate())",username,error);

            SqlCommand cmd = new SqlCommand(sql);

            db.ExecuetNonQuery(cmd);
        }
    }