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


C# SqlParameterHelper.ExecuteScalar方法代码示例

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


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

示例1: CountOtherSites

        public static int CountOtherSites(int currentSiteId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Sites_CountOtherSites", 1);
            sph.DefineSqlParameter("@CurrentSiteID", SqlDbType.Int, ParameterDirection.Input, currentSiteId);

            return Convert.ToInt32(sph.ExecuteScalar());
        }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:7,代码来源:dbSiteSettings.cs

示例2: AddHistory

 public static bool AddHistory(
     Guid itemGuid,
     Guid moduleGuid,
     Guid userGuid,
     int itemId,
     int moduleId,
     string friendlyName,
     string originalFileName,
     string serverFileName,
     int sizeInKB,
     DateTime uploadDate,
     int uploadUserId,
     DateTime archiveDate)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_SharedFilesHistory_Insert", 12);
     sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
     sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
     sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
     sph.DefineSqlParameter("@ItemID", SqlDbType.Int, ParameterDirection.Input, itemId);
     sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
     sph.DefineSqlParameter("@FriendlyName", SqlDbType.NVarChar, 255, ParameterDirection.Input, friendlyName);
     sph.DefineSqlParameter("@OriginalFileName", SqlDbType.NVarChar, 255, ParameterDirection.Input, originalFileName);
     sph.DefineSqlParameter("@ServerFileName", SqlDbType.NVarChar, 50, ParameterDirection.Input, serverFileName);
     sph.DefineSqlParameter("@SizeInKB", SqlDbType.Int, ParameterDirection.Input, sizeInKB);
     sph.DefineSqlParameter("@UploadDate", SqlDbType.DateTime, ParameterDirection.Input, uploadDate);
     sph.DefineSqlParameter("@UploadUserID", SqlDbType.Int, ParameterDirection.Input, uploadUserId);
     sph.DefineSqlParameter("@ArchiveDate", SqlDbType.DateTime, ParameterDirection.Input, archiveDate);
     int newID = Convert.ToInt32(sph.ExecuteScalar());
     return (newID > 0);
 }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:30,代码来源:DBSharedFiles.cs

示例3: GetNextPageOrder

 public static int GetNextPageOrder(Guid userGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_UserPages_GetNextPageOrder", 1);
     sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
     int pageOrder = Convert.ToInt32(sph.ExecuteScalar());
     return pageOrder;
 }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:7,代码来源:dbUserPage.cs

示例4: Exists

 public static bool Exists(string folderName)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_SiteFolder_Exists", 1);
     sph.DefineSqlParameter("@FolderName", SqlDbType.NVarChar, 255, ParameterDirection.Input, folderName);
     int count = Convert.ToInt32(sph.ExecuteScalar());
     return (count > 0);
 }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:7,代码来源:dbSiteFolder.cs

示例5: Count

 public static int Count(int siteId)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_WebParts_GetCount", 1);
     sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
     int count = Convert.ToInt32(sph.ExecuteScalar());
     return count;
 }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:7,代码来源:dbWebPartContent.cs

示例6: AddLink

 public static int AddLink(
     Guid itemGuid,
     Guid moduleGuid,
     int moduleId,
     string title,
     string url,
     int viewOrder,
     string description,
     DateTime createdDate,
     int createdBy,
     string target,
     Guid userGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_Links_Insert", 11);
     sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
     sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
     sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
     sph.DefineSqlParameter("@Title", SqlDbType.NVarChar, 255, ParameterDirection.Input, title);
     sph.DefineSqlParameter("@Url", SqlDbType.NVarChar, -1, ParameterDirection.Input, url);
     sph.DefineSqlParameter("@ViewOrder", SqlDbType.Int, ParameterDirection.Input, viewOrder);
     sph.DefineSqlParameter("@Description", SqlDbType.NVarChar, -1, ParameterDirection.Input, description);
     sph.DefineSqlParameter("@CreatedDate", SqlDbType.DateTime, ParameterDirection.Input, createdDate);
     sph.DefineSqlParameter("@CreatedBy", SqlDbType.Int, ParameterDirection.Input, createdBy);
     sph.DefineSqlParameter("@Target", SqlDbType.NVarChar, 20, ParameterDirection.Input, target);
     sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
     int newID = Convert.ToInt32(sph.ExecuteScalar());
     return newID;
 }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:28,代码来源:DBLinks.cs

示例7: AddRssFeed

        public static int AddRssFeed(
            Guid itemGuid,
            Guid moduleGuid,
            Guid userGuid,
            int moduleId,
            int userId,
            string author,
            string url,
            string rssUrl,
            DateTime createdUtc,
            string imageUrl,
            string feedType,
            bool publishByDefault,
            int sortRank)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_RssFeeds_Insert", 13);

            sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
            sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
            sph.DefineSqlParameter("@UserID", SqlDbType.Int, ParameterDirection.Input, userId);
            sph.DefineSqlParameter("@Author", SqlDbType.NVarChar, 100, ParameterDirection.Input, author);
            sph.DefineSqlParameter("@Url", SqlDbType.NVarChar, -1, ParameterDirection.Input, url);
            sph.DefineSqlParameter("@RssUrl", SqlDbType.NVarChar, 255, ParameterDirection.Input, rssUrl);
            sph.DefineSqlParameter("@CreatedDate", SqlDbType.DateTime, ParameterDirection.Input, createdUtc);
            sph.DefineSqlParameter("@ImageUrl", SqlDbType.NVarChar, 255, ParameterDirection.Input, imageUrl);
            sph.DefineSqlParameter("@FeedType", SqlDbType.NVarChar, 20, ParameterDirection.Input, feedType);
            sph.DefineSqlParameter("@PublishByDefault", SqlDbType.Bit, ParameterDirection.Input, publishByDefault);
            sph.DefineSqlParameter("@SortRank", SqlDbType.Int, ParameterDirection.Input, sortRank);

            int newID = Convert.ToInt32(sph.ExecuteScalar());
            return newID;
        }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:34,代码来源:DBRssFeed.cs

示例8: GetCountOfSiteRoles

        public static int GetCountOfSiteRoles(int siteId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Roles_CountBySite", 1);
            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);

            return Convert.ToInt32(sph.ExecuteScalar());
        }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:7,代码来源:dbRoles.cs

示例9: AddHtmlContent

 public static int AddHtmlContent(
     Guid itemGuid,
     Guid moduleGuid,
     int moduleId,
     string title,
     string excerpt,
     string body,
     string moreLink,
     int sortOrder,
     DateTime beginDate,
     DateTime endDate,
     DateTime createdDate,
     int userId,
     Guid userGuid,
     bool excludeFromRecentContent)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_HtmlContent_Insert", 14);
     sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
     sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
     sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
     sph.DefineSqlParameter("@Title", SqlDbType.NVarChar, 255, ParameterDirection.Input, title);
     sph.DefineSqlParameter("@Excerpt", SqlDbType.NVarChar, -1, ParameterDirection.Input, excerpt);
     sph.DefineSqlParameter("@Body", SqlDbType.NVarChar, -1, ParameterDirection.Input, body);
     sph.DefineSqlParameter("@MoreLink", SqlDbType.NVarChar, 255, ParameterDirection.Input, moreLink);
     sph.DefineSqlParameter("@SortOrder", SqlDbType.Int, ParameterDirection.Input, sortOrder);
     sph.DefineSqlParameter("@BeginDate", SqlDbType.DateTime, ParameterDirection.Input, beginDate);
     sph.DefineSqlParameter("@EndDate", SqlDbType.DateTime, ParameterDirection.Input, endDate);
     sph.DefineSqlParameter("@CreatedDate", SqlDbType.DateTime, ParameterDirection.Input, createdDate);
     sph.DefineSqlParameter("@UserID", SqlDbType.Int, ParameterDirection.Input, userId);
     sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
     sph.DefineSqlParameter("@ExcludeFromRecentContent", SqlDbType.Bit, ParameterDirection.Input, excludeFromRecentContent);
     int newID = Convert.ToInt32(sph.ExecuteScalar());
     return newID;
 }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:34,代码来源:dbHtmlContent.cs

示例10: AddGalleryImage

 public static int AddGalleryImage(
     Guid itemGuid,
     Guid moduleGuid,
     int moduleId,
     int displayOrder,
     string caption,
     string description,
     string metaDataXml,
     string imageFile,
     string webImageFile,
     string thumbnailFile,
     DateTime uploadDate,
     string uploadUser,
     Guid userGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_GalleryImages_Insert", 13);
     sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
     sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
     sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
     sph.DefineSqlParameter("@DisplayOrder", SqlDbType.Int, ParameterDirection.Input, displayOrder);
     sph.DefineSqlParameter("@Caption", SqlDbType.NVarChar, 255, ParameterDirection.Input, caption);
     sph.DefineSqlParameter("@Description", SqlDbType.NVarChar, -1, ParameterDirection.Input, description);
     sph.DefineSqlParameter("@MetaDataXml", SqlDbType.NVarChar, -1, ParameterDirection.Input, metaDataXml);
     sph.DefineSqlParameter("@ImageFile", SqlDbType.NVarChar, 100, ParameterDirection.Input, imageFile);
     sph.DefineSqlParameter("@WebImageFile", SqlDbType.NVarChar, 100, ParameterDirection.Input, webImageFile);
     sph.DefineSqlParameter("@ThumbnailFile", SqlDbType.NVarChar, 100, ParameterDirection.Input, thumbnailFile);
     sph.DefineSqlParameter("@UploadDate", SqlDbType.DateTime, ParameterDirection.Input, uploadDate);
     sph.DefineSqlParameter("@UploadUser", SqlDbType.NVarChar, 100, ParameterDirection.Input, uploadUser);
     sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
     int newID = Convert.ToInt32(sph.ExecuteScalar());
     return newID;
 }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:32,代码来源:DBGallery.cs

示例11: Exists

 /// <summary>
 /// returns true if the record exists
 /// </summary>
 /// <param name="rowGuid"> rowGuid </param>
 public static bool Exists(int siteId, string oldUrl)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_RedirectList_Exists", 2);
     sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
     sph.DefineSqlParameter("@OldUrl", SqlDbType.NVarChar, 255, ParameterDirection.Input, oldUrl);
     int count = Convert.ToInt32(sph.ExecuteScalar());
     return (count > 0);
 }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:12,代码来源:DBRedirectList.cs

示例12: Exists

 public static bool Exists(int siteId, string roleName)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Roles_RoleExists", 2);
     sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
     sph.DefineSqlParameter("@RoleName", SqlDbType.NVarChar, 50, ParameterDirection.Input, roleName);
     int count = Convert.ToInt32(sph.ExecuteScalar());
     return (count > 0);
 }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:8,代码来源:dbRoles.cs

示例13: CountUsersNotSubscribedByLetter

        public static int CountUsersNotSubscribedByLetter(Guid siteGuid, Guid letterInfoGuid, bool excludeIfAnyUnsubscribeHx)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_LetterInfoCountUsersNotSubscribed", 3);
            sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
            sph.DefineSqlParameter("@LetterInfoGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, letterInfoGuid);
            sph.DefineSqlParameter("@ExcludeIfAnyUnsubscribeHx", SqlDbType.Bit, ParameterDirection.Input, excludeIfAnyUnsubscribeHx);

            return Convert.ToInt32(sph.ExecuteScalar());
        }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:9,代码来源:DBLetterSubscription.cs

示例14: Exists

 public static bool Exists(Int32 siteId, String className, String assemblyName)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_WebParts_WebPartExists", 3);
     sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
     sph.DefineSqlParameter("@ClassName", SqlDbType.NVarChar, 255, ParameterDirection.Input, className);
     sph.DefineSqlParameter("@AssemblyName", SqlDbType.NVarChar, 255, ParameterDirection.Input, assemblyName);
     int count = Convert.ToInt32(sph.ExecuteScalar());
     return (count > 0);
 }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:9,代码来源:dbWebPartContent.cs

示例15: AddSubscriber

 public static bool AddSubscriber(int forumId, int userId, Guid subGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_ForumSubscriptions_Insert", 4);
     sph.DefineSqlParameter("@ForumID", SqlDbType.Int, ParameterDirection.Input, forumId);
     sph.DefineSqlParameter("@UserID", SqlDbType.Int, ParameterDirection.Input, userId);
     sph.DefineSqlParameter("@SubGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, subGuid);
     sph.DefineSqlParameter("@SubscribeDate", SqlDbType.DateTime, ParameterDirection.Input, DateTime.UtcNow);
     int rowsAffected = Convert.ToInt32(sph.ExecuteScalar());
     return (rowsAffected > 0);
 }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:10,代码来源:DBForums.cs


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