當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。