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


C# DBManager.executeNonQuery方法代码示例

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


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

示例1: AddMultiGroupUser

 public static void AddMultiGroupUser(string userName, string password, string email, string userFirstName, string userLastName, string remarks, string groupIds)
 {
     string message;
     string sErr = "";
     DBManager db = new DBManager(ConfigurationManager.AppSettings["SYS_DSN"]);
     if (remarks == null)
     {
         remarks = "";
     }
     if (userFirstName == null)
     {
         userFirstName = "";
     }
     if (userLastName == null)
     {
         userLastName = "";
     }
     try
     {
         Membership.CreateUser(userName, password, email);
         string[] strArrays = new string[] { "exec spSysAddUserToGroups @GroupIds='", groupIds, "', @UserName='", userName, "'" };
         string sql = string.Concat(strArrays);
         db.executeNonQuery(sql, out sErr);
         strArrays = new string[] { "exec spSysUpdateUserAdditionalData @UserName=", DBManager.quoteForDB(userName), ", @remarks=", DBManager.quoteForDB(remarks), ", @FirstName=", DBManager.quoteForDB(userFirstName), ", @LastName=", DBManager.quoteForDB(userLastName) };
         sql = string.Concat(strArrays);
         db.executeNonQuery(sql, out sErr);
         db.CloseOleDB();
         if (sErr != "")
         {
             message = string.Format("<script>alert('{0}\\n\\n{1}')</script>", "הוספת המשתמש נכשלה", sErr);
             HttpContext.Current.Response.Write(message);
         }
     }
     catch (MembershipCreateUserException membershipCreateUserException)
     {
         message = string.Format("<script>alert('{0}\\n\\n{1}')</script>", "הוספת המשתמש נכשלה", membershipCreateUserException.Message);
         HttpContext.Current.Response.Write(message);
     }
 }
开发者ID:ranyaof,项目名称:gismaster,代码行数:39,代码来源:UserManager.cs

示例2: DeleteUserCreatedGroup

 public static void DeleteUserCreatedGroup(string GroupId)
 {
     string sErr = "";
     string message = "";
     DBManager db = new DBManager(ConfigurationManager.AppSettings["SYS_DSN"]);
     try
     {
         string sql = string.Concat("exec spSysIsGroupByApplicationUse @GroupId=", GroupId);
         DataTable dt = db.getDataTable(sql, out sErr);
         if (sErr != "")
         {
             db.CloseOleDB();
             message = string.Format("<script>alert('{0}\\n\\n{1}')</script>", "מחיקה קבוצה נכשלה", sErr);
             HttpContext.Current.Response.Write(message);
         }
         if (dt.Rows.Count != 0)
         {
             sql = string.Concat("exec spSysDeleteGroup @GroupId=", GroupId);
             db.executeNonQuery(sql, out sErr);
             if (sErr != "")
             {
                 db.CloseOleDB();
                 message = string.Format("<script>alert('{0}\\n\\n{1}')</script>", "מחיקה קבוצה נכשלה", sErr);
                 HttpContext.Current.Response.Write(message);
             }
         }
         else
         {
             db.CloseOleDB();
             message = string.Format("<script>alert('{0}\\n\\n{1}')</script>", "לא ניתן למחוק קבוצה מקושרת למודול", sErr);
             HttpContext.Current.Response.Write(message);
         }
     }
     catch (Exception exception)
     {
         message = string.Format("<script>alert('{0}\\n\\n{1}')</script>", "מחיקה קבוצה נכשלה", exception.Message);
         HttpContext.Current.Response.Write(message);
     }
 }
开发者ID:ranyaof,项目名称:gismaster,代码行数:39,代码来源:UserManager.cs

示例3: CreateNewGroup

 public static void CreateNewGroup(string name, string permission)
 {
     string message;
     string sErr = "";
     DBManager db = new DBManager(ConfigurationManager.AppSettings["SYS_DSN"]);
     try
     {
         string sql = string.Concat("exec spSysAddNewGroup @GroupName='", name, "', @Permission=", permission);
         db.executeNonQuery(sql, out sErr);
         db.CloseOleDB();
         if (sErr != "")
         {
             message = string.Format("<script>alert('{0}\\n\\n{1}')</script>", "הוספת קבוצה נכשלה", sErr);
             HttpContext.Current.Response.Write(message);
         }
     }
     catch (Exception exception)
     {
         message = string.Format("<script>alert('{0}\\n\\n{1}')</script>", "הוספת קבוצה נכשלה", exception.Message);
         HttpContext.Current.Response.Write(message);
     }
 }
开发者ID:ranyaof,项目名称:gismaster,代码行数:22,代码来源:UserManager.cs


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