2007年8月9日 星期四

web deployment projects

可於 http://msdn2.microsoft.com/en-US/asp.net/aa336619.aspx 下載。

其功能,相當於使用 aspnet_compiler.exe 及使用 aspnet_merge.exe ,但是有GUI界面。

可惜,我習慣使用 web application project 的模式開發 asp.net。而web deployment projects只適用 web sites

2007年8月6日 星期一

Cannot create/shadow copy 'xxx' when that file already exists.

使用 VS2005 sp1 開發程式時,常常發生如標題的錯誤。 可是,只要再等個30秒,1分鐘,再執行網頁,就可以了。 真是奇怪。 原來,在 vs2005 sp1 上,增加上 copy on write 的技術,可是在xp 上,好像不太管用。 解法: 在 web.config 上設定一下,就可以了 。 不過呢,使用 VS2005 build asp.net 應用程式時,這樣的設定又會出現 vs2003 常見的問題 Error 749 Unable to copy file "obj\Debug\xxx.dll" to "bin\xxx.dll". The process cannot access the file 'bin\BankPro.WEB.EInvoice.dll' because it is being used by another process. EInvoice2 這就了解了為什麼vs2005 sp1有這的設定了

2007年7月27日 星期五

web.config 加解密

aspnet_regiis -pe "connectionStrings" -app "/WebSite3" -prov "DataProtectionConfigurationProvider" 好方便,這樣就加密了,不用寫程式 另外,-pd 是解密。解密時不用指定 provider aspnet_regiis -pd "connectionStrings" -app "/WebSite3"

2007年7月23日 星期一

MSDTC 設定

每次使用 TransactionScope ,再使用two face commit 時,常常遇到 MSDTC 設定不正確的問題。 今天看到 http://darkthread.blogspot.com/2006/11/kb-net-20-transactionscope.html 這裡的講解,實在太好了。 忍不住記下來 這個也很重要 http://darkthread.blogspot.com/2006/03/msdtc-on-windows-2003-sp1.html

2007年7月20日 星期五

partition by field order by field

存進資料庫時,之前為了弄出序號般的東西,通常會使用 identity 的欄位。 這是直接寫入資料庫的。通常結合 primary key ,於設計時期就規劃好這樣的欄位。 但,有時,常常,需要在UI顯示給使用者的序號,是不用寫入資料庫的。 如 訂單主檔 訂單編號 (primary key) 客戶編號 建立日期 訂單明細檔 訂單編號 產品名稱 數量 序號 (該訂單明細的明細流水號,由1開始) 像這樣的序號欄號,是有規則的,不必寫到資料庫。 以前在UI要呈現這樣的序號,可以使用UI的技巧。有時需要多一點的運算。 現在,SQL Server 2005 提供了這樣的語法層級上的支援 如 select m.BillNo, d.ProductName, d.Qty1, d.UnitQty, d.UnitPrice, NetAmount, row_number() over (partition by d.billNo order by d.billNo) as rowNum from Einvoice.dbo.invoice m inner join Einvoice.dbo.invoiceDetail d on m.BillNo = d.billNo

2007年7月16日 星期一

Sys.argumentOUtOfRangeException Value must be an integer

當我使用AJAX Toolkit 的 calendarExtender 時,發生了一個JScript錯誤 Sys.argumentOUtOfRangeException Value must be an integer Parameter anme:x Actual value was NaN 完全不知道是怎麼回事。 爬了 google,找到了原因。原來我使用了 frameset,其中的 frameborder 的值,"1", "0", "Yes", "No" 都是合法的值。 但 AJAX ToolKit 卻只認得 "1", "0" 改了之後就OK 了

2007年7月12日 星期四

'~/Root/GotoSite.aspx?site=SCIS&winType=2&url=http://www.google.com.tw' is not a valid virtual path.

寫 custom site map provider 時,發生了這樣的問題

'~/Root/GotoSite.aspx?site=SCIS&winType=2&url=http://www.google.com.tw' is not a valid virtual path.

耶?為什麼? 原來,原因指定SiteMapNode的Url 時,指定的值中有 Colon (:) Asterisk (*) 有這兩個字,就會被認為不合法。 微軟有沒有解呢?有的,見http://support.microsoft.com/kb/932552/en-us?spid=8940&sid=global

要裝hotfix哦!真是麻煩

Share with Facebook