本文整理汇总了C#中SqlParameterHelper.ExecuteReader方法的典型用法代码示例。如果您正苦于以下问题:C# SqlParameterHelper.ExecuteReader方法的具体用法?C# SqlParameterHelper.ExecuteReader怎么用?C# SqlParameterHelper.ExecuteReader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SqlParameterHelper
的用法示例。
在下文中一共展示了SqlParameterHelper.ExecuteReader方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetSiteSettingsExList
public DbDataReader GetSiteSettingsExList(int siteId)
{
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
readConnectionString,
"mp_SiteSettingsEx_SelectAll",
1);
sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
return sph.ExecuteReader();
}
示例2: GetUserCountByYearMonth
public DbDataReader GetUserCountByYearMonth(int siteId)
{
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
readConnectionString,
"mp_Users_GetCountByMonthYear",
1);
sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
return sph.ExecuteReader();
}
示例3: EmailLookup
//public DbDataReader GetSmartDropDownData(int siteId, string query, int rowsToGet)
//{
// SqlParameterHelper sph = new SqlParameterHelper(
// logFactory,
// readConnectionString,
// "mp_Users_SmartDropDown",
// 3);
// sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
// sph.DefineSqlParameter("@Query", SqlDbType.NVarChar, 50, ParameterDirection.Input, query);
// sph.DefineSqlParameter("@RowsToGet", SqlDbType.Int, ParameterDirection.Input, rowsToGet);
// return sph.ExecuteReader();
//}
public DbDataReader EmailLookup(int siteId, string query, int rowsToGet)
{
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
readConnectionString,
"mp_Users_EmailLookup",
3);
sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
sph.DefineSqlParameter("@Query", SqlDbType.NVarChar, 50, ParameterDirection.Input, query);
sph.DefineSqlParameter("@RowsToGet", SqlDbType.Int, ParameterDirection.Input, rowsToGet);
return sph.ExecuteReader();
}
示例4: GetDefaultExpandoSettings
public DbDataReader GetDefaultExpandoSettings()
{
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
readConnectionString,
"mp_SiteSettingsExDef_SelectAll",
0);
return sph.ExecuteReader();
}
示例5: GetSchemaVersionFromGuid
private DbDataReader GetSchemaVersionFromGuid(Guid applicationId)
{
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
readConnectionString,
"mp_SchemaVersion_SelectOne",
1);
sph.DefineSqlParameter("@ApplicationID", SqlDbType.UniqueIdentifier, ParameterDirection.Input, applicationId);
return sph.ExecuteReader();
}
示例6: GeByIpAddress
/// <summary>
/// Gets an IDataReader with rows from the mp_BannedIPAddresses table.
/// </summary>
/// <param name="ipAddress"> ipAddress </param>
public DbDataReader GeByIpAddress(string ipAddress)
{
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
readConnectionString,
"mp_BannedIPAddresses_SelectByIP",
1);
sph.DefineSqlParameter("@BannedIP", SqlDbType.NVarChar, 50, ParameterDirection.Input, ipAddress);
return sph.ExecuteReader();
}
示例7: GetLazyLoadedProperty
//public DataTable GetNonLazyLoadedPropertiesForUser(Guid userGuid)
//{
// SqlParameterHelper sph = new SqlParameterHelper(
// logFactory,
// readConnectionString,
// "mp_UserProperties_SelectByUser",
// 1);
// sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
// DataTable dataTable = new DataTable();
// dataTable.Columns.Add("UserGuid", typeof(String));
// dataTable.Columns.Add("PropertyName", typeof(String));
// dataTable.Columns.Add("PropertyValueString", typeof(String));
// // dataTable.Columns.Add("PropertyValueBinary", typeof(object));
// using (DbDataReader reader = sph.ExecuteReader())
// {
// while (reader.Read())
// {
// DataRow row = dataTable.NewRow();
// row["UserGuid"] = reader["UserGuid"].ToString();
// row["PropertyName"] = reader["PropertyName"].ToString();
// row["PropertyValueString"] = reader["PropertyValueString"].ToString();
// //row["PropertyValueBinary"] = reader["PropertyValueBinary"];
// dataTable.Rows.Add(row);
// }
// }
// return dataTable;
//}
public DbDataReader GetLazyLoadedProperty(Guid userGuid, String propertyName)
{
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
readConnectionString,
"mp_UserProperties_SelectOne",
2);
sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
sph.DefineSqlParameter("@PropertyName", SqlDbType.NVarChar, 255, ParameterDirection.Input, propertyName);
return sph.ExecuteReader();
}
示例8: GetSingleUserByLoginNameNonAsync
public DbDataReader GetSingleUserByLoginNameNonAsync(int siteId, string loginName, bool allowEmailFallback)
{
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
readConnectionString,
"mp_Users_SelectByLoginName",
3);
sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
sph.DefineSqlParameter("@LoginName", SqlDbType.NVarChar, 50, ParameterDirection.Input, loginName);
sph.DefineSqlParameter("@AllowEmailFallback", SqlDbType.Bit, ParameterDirection.Input, allowEmailFallback);
return sph.ExecuteReader();
}
示例9: GetRoleMembers
public DbDataReader GetRoleMembers(int roleId)
{
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
readConnectionString,
"mp_UserRoles_SelectByRoleID",
1);
sph.DefineSqlParameter("@RoleID", SqlDbType.Int, ParameterDirection.Input, roleId);
return sph.ExecuteReader();
}
示例10: GetPageBySite
/// <summary>
/// Gets a page of data from the mp_UserLocation table.
/// </summary>
/// <param name="siteGuid"> siteGuid </param>
/// <param name="pageNumber">The page number.</param>
/// <param name="pageSize">Size of the page.</param>
/// <param name="totalPages">total pages</param>
public DbDataReader GetPageBySite(
Guid siteGuid,
int pageNumber,
int pageSize)
{
//totalPages = 1;
//int totalRows
// = GetCountBySite(siteGuid);
//if (pageSize > 0) totalPages = totalRows / pageSize;
//if (totalRows <= pageSize)
//{
// totalPages = 1;
//}
//else
//{
// int remainder;
// Math.DivRem(totalRows, pageSize, out remainder);
// if (remainder > 0)
// {
// totalPages += 1;
// }
//}
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
readConnectionString,
"mp_UserLocation_SelectPageBySite",
3);
sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
sph.DefineSqlParameter("@PageNumber", SqlDbType.Int, ParameterDirection.Input, pageNumber);
sph.DefineSqlParameter("@PageSize", SqlDbType.Int, ParameterDirection.Input, pageSize);
return sph.ExecuteReader();
}
示例11: GetPage
/// <summary>
/// Gets a page of data from the mp_RedirectList table.
/// </summary>
/// <param name="pageNumber">The page number.</param>
/// <param name="pageSize">Size of the page.</param>
/// <param name="totalPages">total pages</param>
public DbDataReader GetPage(
int siteId,
int pageNumber,
int pageSize)
{
//totalPages = 1;
//int totalRows = GetCount(siteId);
//if (pageSize > 0) totalPages = totalRows / pageSize;
//if (totalRows <= pageSize)
//{
// totalPages = 1;
//}
//else
//{
// int remainder;
// Math.DivRem(totalRows, pageSize, out remainder);
// if (remainder > 0)
// {
// totalPages += 1;
// }
//}
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
readConnectionString,
"mp_RedirectList_SelectPage",
3);
sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
sph.DefineSqlParameter("@PageNumber", SqlDbType.Int, ParameterDirection.Input, pageNumber);
sph.DefineSqlParameter("@PageSize", SqlDbType.Int, ParameterDirection.Input, pageSize);
return sph.ExecuteReader();
}
示例12: GetBySiteAndUrl
/// <summary>
/// Gets an DbDataReader with one row from the mp_RedirectList table.
/// </summary>
/// <param name="rowGuid"> rowGuid </param>
public DbDataReader GetBySiteAndUrl(int siteId, string oldUrl)
{
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
readConnectionString,
"mp_RedirectList_SelectBySiteAndUrl",
3);
sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
sph.DefineSqlParameter("@OldUrl", SqlDbType.NVarChar, 255, ParameterDirection.Input, oldUrl);
sph.DefineSqlParameter("@CurrentTime", SqlDbType.DateTime, ParameterDirection.Input, DateTime.UtcNow);
return sph.ExecuteReader();
}
示例13: GetOne
/// <summary>
/// Gets an DbDataReader with one row from the mp_RedirectList table.
/// </summary>
/// <param name="rowGuid"> rowGuid </param>
public DbDataReader GetOne(Guid rowGuid)
{
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
readConnectionString,
"mp_RedirectList_SelectOne",
1);
sph.DefineSqlParameter("@RowGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, rowGuid);
return sph.ExecuteReader();
}
示例14: GetPageUnfinished
/// <summary>
/// Gets a page of data from the mp_TaskQueue table.
/// </summary>
/// <param name="pageNumber">The page number.</param>
/// <param name="pageSize">Size of the page.</param>
public DbDataReader GetPageUnfinished(
int pageNumber,
int pageSize)
{
//totalPages = 1;
//int totalRows
// = GetCountUnfinished();
//if (pageSize > 0) totalPages = totalRows / pageSize;
//if (totalRows <= pageSize)
//{
// totalPages = 1;
//}
//else
//{
// int remainder;
// Math.DivRem(totalRows, pageSize, out remainder);
// if (remainder > 0)
// {
// totalPages += 1;
// }
//}
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
readConnectionString,
"mp_TaskQueue_SelectPageIncomplete",
2);
sph.DefineSqlParameter("@PageNumber", SqlDbType.Int, ParameterDirection.Input, pageNumber);
sph.DefineSqlParameter("@PageSize", SqlDbType.Int, ParameterDirection.Input, pageSize);
return sph.ExecuteReader();
}
示例15: GetUnfinished
/// <summary>
/// Gets an IDataReader with all incomplete tasks in the mp_TaskQueue table.
/// </summary>
/// <param name="siteGuid"> guid </param>
public DbDataReader GetUnfinished(Guid siteGuid)
{
SqlParameterHelper sph = new SqlParameterHelper(
logFactory,
readConnectionString,
"mp_TaskQueue_SelectIncompleteBySite",
1);
sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
return sph.ExecuteReader();
}