本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}