本文整理汇总了C#中SqlParameterHelper.ExecuteNonQuery方法的典型用法代码示例。如果您正苦于以下问题:C# SqlParameterHelper.ExecuteNonQuery方法的具体用法?C# SqlParameterHelper.ExecuteNonQuery怎么用?C# SqlParameterHelper.ExecuteNonQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SqlParameterHelper
的用法示例。
在下文中一共展示了SqlParameterHelper.ExecuteNonQuery方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
/// <summary>
/// Inserts a row in the mp_RedirectList table. Returns rows affected count.
/// </summary>
/// <param name="rowGuid"> rowGuid </param>
/// <param name="siteGuid"> siteGuid </param>
/// <param name="siteID"> siteID </param>
/// <param name="oldUrl"> oldUrl </param>
/// <param name="newUrl"> newUrl </param>
/// <param name="createdUtc"> createdUtc </param>
/// <param name="expireUtc"> expireUtc </param>
/// <returns>int</returns>
public int Create(
Guid rowGuid,
Guid siteGuid,
int siteID,
string oldUrl,
string newUrl,
DateTime createdUtc,
DateTime expireUtc)
{
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
writeConnectionString,
"mp_RedirectList_Insert",
7);
sph.DefineSqlParameter("@RowGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, rowGuid);
sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteID);
sph.DefineSqlParameter("@OldUrl", SqlDbType.NVarChar, 255, ParameterDirection.Input, oldUrl);
sph.DefineSqlParameter("@NewUrl", SqlDbType.NVarChar, 255, ParameterDirection.Input, newUrl);
sph.DefineSqlParameter("@CreatedUtc", SqlDbType.DateTime, ParameterDirection.Input, createdUtc);
sph.DefineSqlParameter("@ExpireUtc", SqlDbType.DateTime, ParameterDirection.Input, expireUtc);
int rowsAffected = sph.ExecuteNonQuery();
return rowsAffected;
}
示例2: Update
/// <summary>
/// Updates a row in the mp_BannedIPAddresses table. Returns true if row updated.
/// </summary>
/// <param name="rowID"> rowID </param>
/// <param name="bannedIP"> bannedIP </param>
/// <param name="bannedUTC"> bannedUTC </param>
/// <param name="bannedReason"> bannedReason </param>
/// <returns>bool</returns>
public bool Update(
int rowId,
string bannedIP,
DateTime bannedUtc,
string bannedReason)
{
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
writeConnectionString,
"mp_BannedIPAddresses_Update",
4);
sph.DefineSqlParameter("@RowID", SqlDbType.Int, ParameterDirection.Input, rowId);
sph.DefineSqlParameter("@BannedIP", SqlDbType.NVarChar, 50, ParameterDirection.Input, bannedIP);
sph.DefineSqlParameter("@BannedUTC", SqlDbType.DateTime, ParameterDirection.Input, bannedUtc);
sph.DefineSqlParameter("@BannedReason", SqlDbType.NVarChar, 255, ParameterDirection.Input, bannedReason);
int rowsAffected = sph.ExecuteNonQuery();
return (rowsAffected > 0);
}
示例3: SaveExpandoProperty
public bool SaveExpandoProperty(
int siteId,
Guid siteGuid,
string groupName,
string keyName,
string keyValue)
{
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
writeConnectionString,
"mp_SiteSettingsEx_Save",
5);
sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
sph.DefineSqlParameter("@KeyName", SqlDbType.NVarChar, 128, ParameterDirection.Input, keyName);
sph.DefineSqlParameter("@KeyValue", SqlDbType.NVarChar, -1, ParameterDirection.Input, keyValue);
sph.DefineSqlParameter("@GroupName", SqlDbType.NVarChar, 255, ParameterDirection.Input, keyName);
int rowsAffected = sph.ExecuteNonQuery();
return (rowsAffected > -1);
}
示例4: Login
public string Login(int siteId, string loginName, string password)
{
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
readConnectionString,
"mp_Users_Login",
4);
sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
sph.DefineSqlParameter("@LoginName", SqlDbType.NVarChar, 50, ParameterDirection.Input, loginName);
sph.DefineSqlParameter("@Password", SqlDbType.NVarChar, 1000, ParameterDirection.Input, password);
sph.DefineSqlParameter("@UserName", SqlDbType.NVarChar, 100, ParameterDirection.InputOutput, null);
sph.ExecuteNonQuery();
if (sph.Parameters[3] != null)
{
return sph.Parameters[3].Value.ToString();
}
else
{
return string.Empty;
}
}
示例5: UpdateRelatedSites
public bool UpdateRelatedSites(
int siteId,
bool allowNewRegistration,
bool useSecureRegistration,
bool useLdapAuth,
bool autoCreateLdapUserOnFirstLogin,
string ldapServer,
string ldapDomain,
int ldapPort,
string ldapRootDN,
string ldapUserDNKey,
bool allowUserFullNameChange,
bool useEmailForLogin,
bool allowOpenIdAuth,
bool allowWindowsLiveAuth,
bool allowPasswordRetrieval,
bool allowPasswordReset,
bool requiresQuestionAndAnswer,
int maxInvalidPasswordAttempts,
int passwordAttemptWindowMinutes,
bool requiresUniqueEmail,
int passwordFormat,
int minRequiredPasswordLength,
int minReqNonAlphaChars,
string pwdStrengthRegex
)
{
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
writeConnectionString,
"mp_Sites_UpdateRelatedSiteSecurity",
24);
sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
sph.DefineSqlParameter("@AllowNewRegistration", SqlDbType.Bit, ParameterDirection.Input, allowNewRegistration);
sph.DefineSqlParameter("@UseSecureRegistration", SqlDbType.Bit, ParameterDirection.Input, useSecureRegistration);
sph.DefineSqlParameter("@UseLdapAuth", SqlDbType.Bit, ParameterDirection.Input, useLdapAuth);
sph.DefineSqlParameter("@AutoCreateLDAPUserOnFirstLogin", SqlDbType.Bit, ParameterDirection.Input, autoCreateLdapUserOnFirstLogin);
sph.DefineSqlParameter("@LdapServer", SqlDbType.NVarChar, 255, ParameterDirection.Input, ldapServer);
sph.DefineSqlParameter("@LdapDomain", SqlDbType.NVarChar, 255, ParameterDirection.Input, ldapDomain);
sph.DefineSqlParameter("@LdapPort", SqlDbType.Int, ParameterDirection.Input, ldapPort);
sph.DefineSqlParameter("@LdapRootDN", SqlDbType.NVarChar, 255, ParameterDirection.Input, ldapRootDN);
sph.DefineSqlParameter("@LdapUserDNKey", SqlDbType.NVarChar, 10, ParameterDirection.Input, ldapUserDNKey);
sph.DefineSqlParameter("@AllowUserFullNameChange", SqlDbType.Bit, ParameterDirection.Input, allowUserFullNameChange);
sph.DefineSqlParameter("@UseEmailForLogin", SqlDbType.Bit, ParameterDirection.Input, useEmailForLogin);
sph.DefineSqlParameter("@AllowOpenIDAuth", SqlDbType.Bit, ParameterDirection.Input, allowOpenIdAuth);
sph.DefineSqlParameter("@AllowWindowsLiveAuth", SqlDbType.Bit, ParameterDirection.Input, allowWindowsLiveAuth);
sph.DefineSqlParameter("@AllowPasswordRetrieval", SqlDbType.Bit, ParameterDirection.Input, allowPasswordRetrieval);
sph.DefineSqlParameter("@AllowPasswordReset", SqlDbType.Bit, ParameterDirection.Input, allowPasswordReset);
sph.DefineSqlParameter("@RequiresQuestionAndAnswer", SqlDbType.Bit, ParameterDirection.Input, requiresQuestionAndAnswer);
sph.DefineSqlParameter("@MaxInvalidPasswordAttempts", SqlDbType.Int, ParameterDirection.Input, maxInvalidPasswordAttempts);
sph.DefineSqlParameter("@PasswordAttemptWindowMinutes", SqlDbType.Int, ParameterDirection.Input, passwordAttemptWindowMinutes);
sph.DefineSqlParameter("@RequiresUniqueEmail", SqlDbType.Bit, ParameterDirection.Input, requiresUniqueEmail);
sph.DefineSqlParameter("@PasswordFormat", SqlDbType.Int, ParameterDirection.Input, passwordFormat);
sph.DefineSqlParameter("@MinRequiredPasswordLength", SqlDbType.Int, ParameterDirection.Input, minRequiredPasswordLength);
sph.DefineSqlParameter("@MinReqNonAlphaChars", SqlDbType.Int, ParameterDirection.Input, minReqNonAlphaChars);
sph.DefineSqlParameter("@PwdStrengthRegex", SqlDbType.NVarChar, -1, ParameterDirection.Input, pwdStrengthRegex);
int rowsAffected = sph.ExecuteNonQuery();
return (rowsAffected > -1);
}
示例6: UpdateRelatedSitesWindowsLive
public bool UpdateRelatedSitesWindowsLive(
int siteId,
string windowsLiveAppId,
string windowsLiveKey
)
{
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
writeConnectionString,
"mp_Sites_SyncRelatedSitesWinLive",
3);
sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
sph.DefineSqlParameter("@WindowsLiveAppID", SqlDbType.NVarChar, 255, ParameterDirection.Input, windowsLiveAppId);
sph.DefineSqlParameter("@WindowsLiveKey", SqlDbType.NVarChar, 255, ParameterDirection.Input, windowsLiveKey);
int rowsAffected = sph.ExecuteNonQuery();
return (rowsAffected > -1);
}
示例7: UpdatePasswordQuestionAndAnswer
//public bool UpdatePasswordAndSalt(
// int userId,
// int pwdFormat,
// string password,
// string passwordSalt)
//{
// SqlParameterHelper sph = new SqlParameterHelper(
// logFactory,
// writeConnectionString,
// "mp_Users_UpdatePasswordAndSalt",
// 4);
// sph.DefineSqlParameter("@UserID", SqlDbType.Int, ParameterDirection.Input, userId);
// sph.DefineSqlParameter("@Password", SqlDbType.NVarChar, 1000, ParameterDirection.Input, password);
// sph.DefineSqlParameter("@PasswordSalt", SqlDbType.NVarChar, 128, ParameterDirection.Input, passwordSalt);
// sph.DefineSqlParameter("@PwdFormat", SqlDbType.Int, ParameterDirection.Input, pwdFormat);
// int rowsAffected = sph.ExecuteNonQuery();
// return (rowsAffected > -1);
//}
public bool UpdatePasswordQuestionAndAnswer(
Guid userGuid,
String passwordQuestion,
String passwordAnswer)
{
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
writeConnectionString,
"mp_Users_UpdatePasswordQuestionAndAnswer",
3);
sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
sph.DefineSqlParameter("@PasswordQuestion", SqlDbType.NVarChar, 255, ParameterDirection.Input, passwordQuestion);
sph.DefineSqlParameter("@PasswordAnswer", SqlDbType.NVarChar, 255, ParameterDirection.Input, passwordAnswer);
int rowsAffected = sph.ExecuteNonQuery();
return (rowsAffected > -1);
}
示例8: Delete
/// <summary>
/// Deletes a row from the mp_TaskQueue table. Returns true if row deleted.
/// </summary>
/// <param name="guid"> guid </param>
/// <returns>bool</returns>
public bool Delete(Guid guid)
{
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
writeConnectionString,
"mp_TaskQueue_Delete",
1);
sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
int rowsAffected = sph.ExecuteNonQuery();
return (rowsAffected > 0);
}
示例9: UpdateLastPasswordChangeTime
public bool UpdateLastPasswordChangeTime(Guid userGuid, DateTime lastPasswordChangeTime)
{
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
writeConnectionString,
"mp_Users_UpdateLastPasswordChangeTime",
2);
sph.DefineSqlParameter("@UserID", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
sph.DefineSqlParameter("@PasswordChangeTime", SqlDbType.DateTime, ParameterDirection.Input, lastPasswordChangeTime);
int rowsAffected = sph.ExecuteNonQuery();
return (rowsAffected > -1);
}
示例10: UpdateFailedPasswordAnswerAttemptCount
public bool UpdateFailedPasswordAnswerAttemptCount(
Guid userGuid,
int attemptCount)
{
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
writeConnectionString,
"mp_Users_SetFailedPasswordAnswerAttemptCount",
2);
sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
sph.DefineSqlParameter("@AttemptCount", SqlDbType.Int, ParameterDirection.Input, attemptCount);
int rowsAffected = sph.ExecuteNonQuery();
return (rowsAffected > -1);
}
示例11: Delete
/// <summary>
/// Deletes a row from the mp_UserLocation table. Returns true if row deleted.
/// </summary>
/// <param name="rowID"> rowID </param>
/// <returns>bool</returns>
public bool Delete(Guid rowID)
{
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
writeConnectionString,
"mp_UserLocation_Delete",
1);
sph.DefineSqlParameter("@RowID", SqlDbType.UniqueIdentifier, ParameterDirection.Input, rowID);
int rowsAffected = sph.ExecuteNonQuery();
return (rowsAffected > 0);
}
示例12: Create
/// <summary>
/// Inserts a row in the mp_UserLocation table. Returns rows affected count.
/// </summary>
/// <param name="rowID"> rowID </param>
/// <param name="userGuid"> userGuid </param>
/// <param name="siteGuid"> siteGuid </param>
/// <param name="iPAddress"> iPAddress </param>
/// <param name="iPAddressLong"> iPAddressLong </param>
/// <param name="hostname"> hostname </param>
/// <param name="longitude"> longitude </param>
/// <param name="latitude"> latitude </param>
/// <param name="iSP"> iSP </param>
/// <param name="continent"> continent </param>
/// <param name="country"> country </param>
/// <param name="region"> region </param>
/// <param name="city"> city </param>
/// <param name="timeZone"> timeZone </param>
/// <param name="captureCount"> captureCount </param>
/// <param name="firstCaptureUTC"> firstCaptureUTC </param>
/// <param name="lastCaptureUTC"> lastCaptureUTC </param>
/// <returns>int</returns>
public int Create(
Guid rowID,
Guid userGuid,
Guid siteGuid,
string iPAddress,
long iPAddressLong,
string hostname,
double longitude,
double latitude,
string iSP,
string continent,
string country,
string region,
string city,
string timeZone,
int captureCount,
DateTime firstCaptureUTC,
DateTime lastCaptureUTC)
{
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
writeConnectionString,
"mp_UserLocation_Insert",
17);
sph.DefineSqlParameter("@RowID", SqlDbType.UniqueIdentifier, ParameterDirection.Input, rowID);
sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
sph.DefineSqlParameter("@IPAddress", SqlDbType.NVarChar, 50, ParameterDirection.Input, iPAddress);
sph.DefineSqlParameter("@IPAddressLong", SqlDbType.BigInt, ParameterDirection.Input, iPAddressLong);
sph.DefineSqlParameter("@Hostname", SqlDbType.NVarChar, 255, ParameterDirection.Input, hostname);
sph.DefineSqlParameter("@Longitude", SqlDbType.Float, ParameterDirection.Input, longitude);
sph.DefineSqlParameter("@Latitude", SqlDbType.Float, ParameterDirection.Input, latitude);
sph.DefineSqlParameter("@ISP", SqlDbType.NVarChar, 255, ParameterDirection.Input, iSP);
sph.DefineSqlParameter("@Continent", SqlDbType.NVarChar, 255, ParameterDirection.Input, continent);
sph.DefineSqlParameter("@Country", SqlDbType.NVarChar, 255, ParameterDirection.Input, country);
sph.DefineSqlParameter("@Region", SqlDbType.NVarChar, 255, ParameterDirection.Input, region);
sph.DefineSqlParameter("@City", SqlDbType.NVarChar, 255, ParameterDirection.Input, city);
sph.DefineSqlParameter("@TimeZone", SqlDbType.NVarChar, 255, ParameterDirection.Input, timeZone);
sph.DefineSqlParameter("@CaptureCount", SqlDbType.Int, ParameterDirection.Input, captureCount);
sph.DefineSqlParameter("@FirstCaptureUTC", SqlDbType.DateTime, ParameterDirection.Input, firstCaptureUTC);
sph.DefineSqlParameter("@LastCaptureUTC", SqlDbType.DateTime, ParameterDirection.Input, lastCaptureUTC);
int rowsAffected = sph.ExecuteNonQuery();
return rowsAffected;
}
示例13: UpdateStatus
private bool UpdateStatus(
Guid guid,
DateTime lastStatusUpdateUTC,
double completeRatio,
string status)
{
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
writeConnectionString,
"mp_TaskQueue_UpdateStatus",
4);
sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
sph.DefineSqlParameter("@LastStatusUpdateUTC", SqlDbType.DateTime, ParameterDirection.Input, lastStatusUpdateUTC);
sph.DefineSqlParameter("@CompleteRatio", SqlDbType.Float, ParameterDirection.Input, completeRatio);
sph.DefineSqlParameter("@Status", SqlDbType.NVarChar, 255, ParameterDirection.Input, status);
int rowsAffected = sph.ExecuteNonQuery();
return (rowsAffected > 0);
}
示例14: Update
/// <summary>
/// Updates a row in the mp_RedirectList table. Returns true if row updated.
/// </summary>
/// <param name="rowGuid"> rowGuid </param>
/// <param name="oldUrl"> oldUrl </param>
/// <param name="newUrl"> newUrl </param>
/// <param name="expireUtc"> expireUtc </param>
/// <returns>bool</returns>
public bool Update(
Guid rowGuid,
string oldUrl,
string newUrl,
DateTime expireUtc)
{
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
writeConnectionString,
"mp_RedirectList_Update",
4);
sph.DefineSqlParameter("@RowGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, rowGuid);
sph.DefineSqlParameter("@OldUrl", SqlDbType.NVarChar, 255, ParameterDirection.Input, oldUrl);
sph.DefineSqlParameter("@NewUrl", SqlDbType.NVarChar, 255, ParameterDirection.Input, newUrl);
sph.DefineSqlParameter("@ExpireUtc", SqlDbType.DateTime, ParameterDirection.Input, expireUtc);
int rowsAffected = sph.ExecuteNonQuery();
return (rowsAffected > 0);
}
示例15: UpdatePasswordAndSalt
public bool UpdatePasswordAndSalt(
int userId,
int pwdFormat,
string password,
string passwordSalt)
{
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
writeConnectionString,
"mp_Users_UpdatePasswordAndSalt",
4);
sph.DefineSqlParameter("@UserID", SqlDbType.Int, ParameterDirection.Input, userId);
sph.DefineSqlParameter("@Password", SqlDbType.NVarChar, 1000, ParameterDirection.Input, password);
sph.DefineSqlParameter("@PasswordSalt", SqlDbType.NVarChar, 128, ParameterDirection.Input, passwordSalt);
sph.DefineSqlParameter("@PwdFormat", SqlDbType.Int, ParameterDirection.Input, pwdFormat);
int rowsAffected = sph.ExecuteNonQuery();
return (rowsAffected > -1);
}