set nocount onset transaction isolation level read COMMITTEDset deadlock_priority LOW SELECT nvcName as ApplicationName, nErrorCategory, DATEADD(hh,-5,dtSuspendTimeStamp) as DateSuspended, -- Subtract the appropriate hours for your tim
【轉帖】 我們在做winform應用的時候,大部分情況下都會碰到使用多線程式控制制介面上控制項資訊的問題。然而我們並不能用傳統方法來做這個問題,下面我將詳細的介紹。 首先來看傳統方法: public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void
組合模式:將對象組合成樹形結構以表示“部分-整體”的階層。組合模式使得使用者對單個對象和組合對象的使用具有一致性。整體與部分可以被一致對待。(看上去也有遞迴的感覺)類設計圖:DEMO代碼: 代碼Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> class RunCompositePattern {static void Main(string[
代碼Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> class DecoratePattern {static void Main(string[] args) { Person person = new Person("小菜"); Sneaker ydx = new Sneaker(
Thread的本機資料槽 public static CSContext Current { get { LocalDataStoreSlot storeSlot = GetSlot(); CSContext context = Thread.GetData(storeSlot) as CSContext; if (context
CodeCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> DataTable dt = new DataTable(); DataRow dr = dt.NewRow(); int i; dt.Columns.Add(new DataColumn("int", typeof(System.Int32)));
下文摘自:MSDN類索引器(C# 編程指南)索引器允許類或結構的執行個體按照與數組相同的方式進行索引。索引器類似於屬性,不同之處在於它們的訪問器採用參數。在下面的樣本中,定義了一個泛型類,並為其提供了簡單的 get 和 set 訪問器方法(作為分配和檢索值的方法)。Program 類為儲存字串建立了此類的一個執行個體。CodeCode highlighting produced by Actipro CodeHighlighter
在伺服器上安裝了Postgres資料庫,然後通過用戶端工具pgAdminIII來遠端存取的過程中發現提醒伺服器沒有啟動監聽的錯誤。解決方案如下:編輯Postgres安裝路徑下的/data/pg_hba.conf 檔案:e.g: # TYPE DATABASE USER CIDR-ADDRESS METHOD# IPv4 local connections:host all all 127.0.0.1/32