当前位置: 首页>>代码示例>>C#>>正文


C# Database.ExecuteScalarNon方法代码示例

本文整理汇总了C#中Database.ExecuteScalarNon方法的典型用法代码示例。如果您正苦于以下问题:C# Database.ExecuteScalarNon方法的具体用法?C# Database.ExecuteScalarNon怎么用?C# Database.ExecuteScalarNon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Database的用法示例。


在下文中一共展示了Database.ExecuteScalarNon方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: VerifyTokenPasswordReset

 public static string VerifyTokenPasswordReset(string token, string email)
 {
     Database db = new Database(ConnectionManager.GetDatabaseConnectionString());
     object o = db.ExecuteScalarNon("SELECT 1 from FB_AMAD_USERMASTER WHERE ActivationToken = '" + token + "' and EmailAddress = '" + email + "' and TokenExpiryDate >= '" + DateTime.Now.ToString("yyyy-MM-dd") + "'");
     return string.Format(o != null ? Convert.ToString(o) : "0");
 }
开发者ID:pank1982,项目名称:mydoc,代码行数:6,代码来源:Users.cs

示例2: validateUserActivation

    //public static string validateLogin()
    //{
    //    Database db = new Database(ConnectionManager.GetDatabaseConnectionString());
    //    SqlParameter p1 = new SqlParameter("LoginName", LoginName);
    //    SqlParameter p2 = new SqlParameter("Password", UserPassword);
    //    SqlParameter p3 = new SqlParameter("ApplicationName", "AMAD");
    //    SqlParameter p4 = new SqlParameter("UserNameType", UserType);
    //    SqlParameter p5 = new SqlParameter("AccountStatus", "");
    //    p5.Direction = ParameterDirection.Output;
    //    object o = db.ExecuteScalarNon("fb_amad_validateUserActivation", p1, p2, p3, p4, p5);
    //    ActivationStatusDesc = Convert.ToString(p5.Value);
    //    return Convert.ToString(p5.Value);
    //}
    public static void validateUserActivation(string token, string email)
    {
        Database db = new Database(ConnectionManager.GetDatabaseConnectionString());
        SqlParameter p1 = new SqlParameter("Token", token);
        SqlParameter p2 = new SqlParameter("EmailAddress", email);
        SqlParameter p3 = new SqlParameter("AccountStatus", 0);
        SqlParameter p4 = new SqlParameter("StatusDesc", "");
        SqlParameter p5 = new SqlParameter("UserId", "");
        p3.Direction = ParameterDirection.Output;
        p4.Direction = ParameterDirection.Output;
        p5.Direction = ParameterDirection.Output;
        object o = db.ExecuteScalarNon("fb_amad_validateUserActivation", p1, p2, p3, p4, p5);

        ActivationStatus = Convert.ToInt32(p3.Value.ToString());
        ActivationStatusDesc = p4.Value.ToString();
        UserId = p5.Value.ToString();
    }
开发者ID:pank1982,项目名称:mydoc,代码行数:30,代码来源:Users.cs

示例3: UpdatePassword

    public static int UpdatePassword(string pass, string email)
    {
        Database db = new Database(ConnectionManager.GetDatabaseConnectionString());
        SqlParameter p1 = new SqlParameter("Password", pass);
        SqlParameter p2 = new SqlParameter("EmailAddress", email);
        SqlParameter p3 = new SqlParameter("AccountStatus", 0);
        SqlParameter p4 = new SqlParameter("StatusDesc", "");

        p3.Direction = ParameterDirection.Output;
        p4.Direction = ParameterDirection.Output;

        object o = db.ExecuteScalarNon("fb_amad_UpdatePassword", p1, p2, p3, p4);

        return Convert.ToInt32(Convert.ToString(p3.Value));
    }
开发者ID:pank1982,项目名称:mydoc,代码行数:15,代码来源:Users.cs

示例4: checkUserAvailability

 public static string checkUserAvailability()
 {
     Database db = new Database(ConnectionManager.GetDatabaseConnectionString());
     object o = db.ExecuteScalarNon("SELECT 1 from FB_ONLINEUSER WHERE EmailAddress = '" + EmailAddress + "'");
     return string.Format(o != null ? Convert.ToString(o) : "0");
 }
开发者ID:pank1982,项目名称:mydoc,代码行数:6,代码来源:Users.cs

示例5: checkLoginNameAvailability

 public static string checkLoginNameAvailability()
 {
     Database db = new Database(ConnectionManager.GetDatabaseConnectionString());
     object o = db.ExecuteScalarNon("SELECT 1 from FB_AMAD_USERMASTER WHERE LoginName = '" + LoginName + "'");
     return string.Format(o != null ? Convert.ToString(o) : "0");
 }
开发者ID:pank1982,项目名称:mydoc,代码行数:6,代码来源:Users.cs

示例6: ActivateUserAccount

    public static int ActivateUserAccount(Dictionary<string, string> listValues)
    {
        ActivationStatus = 0;
        Database db = new Database(ConnectionManager.GetDatabaseConnectionString());
        SqlParameter p1 = new SqlParameter("UserValues", BuildXML(listValues));
        SqlParameter p2 = new SqlParameter("AccountStatus", 0);
        SqlParameter p3 = new SqlParameter("StatusDesc", "");

        p2.Direction = ParameterDirection.Output;
        p3.Direction = ParameterDirection.Output;

        object o = db.ExecuteScalarNon("fb_amad_AccountActivation", p1, p2, p3);

        if (Convert.ToString(p2.Value) != "")
            ActivationStatus = Convert.ToInt32(Convert.ToString(p2.Value));
        ActivationStatusDesc = Convert.ToString(p3.Value);
        return ActivationStatus;
    }
开发者ID:pank1982,项目名称:mydoc,代码行数:18,代码来源:Users.cs


注:本文中的Database.ExecuteScalarNon方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。