Time of Update: 2018-12-06
Time of Update: 2018-12-06
/// <summary>/// ChunkHelper 協助將序列分成若干塊。/// /// 如果 totalItemCount 是 11,chunkSize 是 5,則:/// chunk[0] 0, 1, 2, 3, 4/// chunk[1] 5, 6, 7, 8, 9/// chunk[2] 10 /// </summary> public class ChunkHelper {/// <summary>//////
Time of Update: 2018-12-06
支援 info.A.B.C 這樣的排序運算式 /// <summary>/// 在 linq 查詢中使用字串運算式進行排序/// </summary> public static class OrderByStringExpressionExtensions {public static IOrderedQueryable<T> OrderBy<T>(this IQueryable<T> source, string
Time of Update: 2018-12-06
摘自 http://www.cnblogs.com/ejiyuan/archive/2009/07/20/1527224.html public static class WhereInExtension {private static Expression<Func<TElement, bool>> BuildWhereInExpression<TElement, TValue>(Expression<Func<TElement,
Time of Update: 2018-12-06
using System;using System.Text;using System.IO;using System.Linq;using System.Net;/// <summary>/// 工具 + 生產力類。這個類支援以get和post方法讀取網頁, 支援代理和cookie/// </summary>public class PageLoader{ public string _proxy = null; public string Proxy {
Time of Update: 2018-12-06
select id from infoid-----------123567810111215(11 行受影響)方法一:select (select max(id)+1 from Info where id<a.id) as beginId,(id-1) as endIdfrom Info awherea.id>(select max(id)+1 from Info where id<a.id)beginId endId----------- -----------4
Time of Update: 2018-12-06
public static class ProtectConfigFileUtil{/// <summary>/// 加密配置節樣本,加密 ConnectionStrings 和 AppSettings/// </summary> [Obsolete("這個方法只是樣本")]public static void ProtectConnectionStringsAndAppSettings(HttpContext context) {
Time of Update: 2018-12-06
use my_databasego--刪除外鍵約束DECLARE c1 cursor forselect 'alter table ['+ object_name(parent_obj) + '] drop constraint ['+name+']; 'from sysobjectswhere xtype = 'F'open c1declare @c1 varchar(8000)fetch next from c1 into
Time of Update: 2018-12-06
文章目錄 問題原因解決 問題NHibernate的many-to-one關聯是支援多態的(理應),然而一不留神,代碼就掉進了陷阱。考慮這個類圖,OrderLine 有一個Product屬性,同時,Product有兩個子類。這個關聯的映射: <many-to-one Name="Product" class="Product" column="ProductId" /> 接下來,要為 Food
Time of Update: 2018-12-06
可以在 Medium Trust Level 下啟動並執行配置聲明配置節 <section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" requirePermission="false"/>配置 <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">&
Time of Update: 2018-12-06
// 代碼來自 http://blog.csdn.net/ojekleen/archive/2008/08/01/2754255.aspx // 有修改 public class ThumbnailGenerator { /// <summary> /// 從源映像產生縮圖 /// </summary> /// <param name="source"></param>
Time of Update: 2018-12-06
/// <summary>/// 基於 ProtectedData 實現的加密解密字串,可以跨windows使用者使用,但是不能跨電腦使用/// </summary> public static class EncryptHelper {public static string Encrypt(string stringToEncrypt) {byte[] toEncrypt =
Time of Update: 2018-12-06
namespace ExtensionMethods{using System;using System.Collections.Generic;using System.Linq;public static class IEnumerableExtensions {/// <summary>/// Invokes a transform function on each element of a sequence and returns the minimum Double
Time of Update: 2018-12-06
<script language =javascript > var curIndex=0; //時間間隔 單位毫秒 var timeInterval=1000; var arr=new
Time of Update: 2018-12-06
文章目錄 nh勝出的地方ef勝出的地方 nh勝出的地方linq文法很舒服,但是hql更強大,由於沒有編譯時間檢查,甚至可以在父物件使用子物件的屬性對於select n+1問題,nh的批量抓取是個不錯的辦法nh有二級緩衝nh提供版本管理ef提供了一個設計器,有了這個設計器,ef在很多實際場合變成了關係資料的附庸,失去了ORM的本性ef勝出的地方ef構造.net對象的速度比nh快ef是MS的,背後的人力財力不是nh能比的ef在medium
Time of Update: 2018-12-06
/// <summary>/// Time 結構表示一天中的某個時間點,精確到秒。與 DateTime 不同,Time 結構不包含日期部分。/// </summary> [Serializable]public struct Time : ISerializable, IXmlSerializable {private int _hour;private int _minute;private int _second;/// <summary>//
Time of Update: 2018-12-06
public static class API { /// <summary> /// 建立有序的 guid。 /// </summary> /// <returns></returns> public static Guid NewSequentialGuid() { Guid result;
Time of Update: 2018-12-06
在做Sharepoint門戶網站定製時候,可以利用VS整合開發工具編寫自訂功能的WebPart或利用VS在可視化環境下開發UserControl然後利用QuickPart使用者控制項封裝器來將UserControl封裝為WebPart,以這種方式來對Sharepoint門戶網站的內容進行靈活定製。也可以利Sharepoint Designer 2007對Sharepoint
Time of Update: 2018-12-06
文檔中寫的是 http://docs.jquery.com/Plugins/Autocomplete/autocomplete#url_or_dataoptions可是我這麼用var a = new Array();#(..).autocomplete(a);報錯 this.source is not a
Time of Update: 2018-12-06
以下以SQL Server 2000中的NorthWind資料庫中的Customers表為例,用 暫存資料表 + While迴圈 的方法, 對Customers表中的CompanyName列進行遍曆create table #temp( id int identity(1,1), customer nvarchar(50))declare @customer nvarchar(50)declare @n intdeclare @rows intselect