2010年12月13日 星期一

String or Binary data would be truncated

今天匯入EXCEL檔資料時,出現這個錯誤

String or Binary data would be truncated 

字串或二進位資料會被截斷

看來是某個欄位太長轉入TABLE時被截掉了,

但到底是哪個欄位?

只好採用刪去法來測試,

原來有個欄位table開varchar(20), 但EXCEL中却超出了長度.

記得以前也曾遇到這個問題,但每次都忘了是到底怎麼回事.

下次應該要先檢查EXCEL中的資料

記錄一下免得又忘了.

2010年12月9日 星期四

BugNet使用二個月的心得

自從10月初開始使用BugNet以來, 我和同事也用這套opensource的工具快2個月了.
大家可以說是愈用愈上癮,因為用這套來做為系統維護的Q&A時,大家將維護過程中遇到的問題及解決過程及個人心得感想全部都一股腦的輸入上去. 害我只得時時提醒大家不要寫一些個人情感抒發文在Comments或Time Tracking上.
同時大家也希望以後公司自己改寫的QA系統可以加上一個個人情感抒發的欄位,讓大家吐一下口水.

用到目前為止,我覺得最好的功能是custom fileds的設定,讓專案維護很有彈性.
再來就是RoadMap的呈現, 哪些還在進行中的問題或已經結案的問題都可以很一目了然

當然,也有一些很煩的地方, 例如有些ISSUS欄位真想要有預設值, 同事抱怨要"打很多字咧"...
還有可以一登入就看到屬於自已的而且跨所有PROJECTS的OPEN ISSUE有哪些嗎? 這也是不錯的建議...
結果今天上BugNet的官網上看, BugNet已有更新版2010/12/05 version 0.8.270.0,而且把這個功能加上去了. 可以參考完整的功能說明


最後,DB的設計我也覺得很清楚,可以很方便讓我寫自已要的報表查詢. 利用pivot 語法,將自訂欄位做一個整合呈現.

這二個月操作上使用很多,但source code就沒看那麼深入,因為偶覺得有點小複雜咧.

等空閒時間多了再來好好細細研究.

http 方式連結 analysis server SQL2008 R2

環境是SQL2008 R2 64 bits, 要建立OLAP HTTP連線
設定方式請參考阿兜仔所寫的文章

Configuring HTTP Access to SQL Server 2008 Analysis Services on Microsoft Windows Server 2008

設定後,在SSMS 2008R2 用http://myserver/olap64/msmdpump.dll 的方式連結到AS Server上.

結果出現這個錯誤訊息...

Cannot connect to http://myserver/olap64/msmdpump.dll.

The connection either timed out or was lost. (Microsoft.AnalysisServices.AdomdClient)

遠端伺服器傳回一個錯誤: (405) 不允許的方法。 (System)


再試著在Excel 2010, 以http連線到AS , 結果出現另一個訊息..

the http server returned the following error: method not allow


反覆檢視文章,檢查了半天, 看來設定沒問題....
(IIS 7的介面真的令人很不習慣,一個設定要找老半天,還要中翻英一下才...)


最後,忙了半天,在教學文章末的討論中找到答案,
由Andy T. 網友所回覆..在iis applicationpool (應用程式集區), 進階設定,將啟用32位元應用程式設成False就好了...

以下是這位Andy阿兜仔說的....

I wanted to add in a comment on 64-bit vs. 32-bit.  I am running Vista Business on a 64-bit machine.  I kept getting "405.0 - Method not allowed" errors when trying the http URL to the msmdpump.dll.  The error seemed as though it was not accepting the POST method, but in fact the issue was that my OLAP application pool should not be enabled for 32-bit applications.  If you go to the advanced settings on the OLAP application pool, the 2nd setting from the very top is, "Enable 32-Bit Applications" and it must be set to "False" since I am running on a 64-bit machine.
- Andy

開啟SSMS, 用http連線.....然後, 就成功了.....
Browse Cube ....冇問題啦
Process ............也冇問題啦

ps.同事說,他使用SQL 2008 64 bits + SP2, 在SSMS中以http方式連結AS SERVER,結果process時, 整個當掉. 目前無解...

2010年11月10日 星期三

Total Commender 找多個副檔名的檔案

Total Commander真不錯用.
很方便找尋某段時間內曾修改或新增的檔案

點選搜尋小圖示後,在尋找檔案的小視窗先切換到一般頁籤,選擇要搜尋的目錄


接著切到外掛頁籤新增規則, 可以依你想要的屬性及操作欄位設定查詢條件,
但當我想要找二個以上的副檔名時,真不知要怎麼下條件咧..

看了一下HELP, 要用正規式(expression)的方式設定,
像我要找2010/11/10 14:00:00後有異動過的.cs及.aspx檔,
就要下cs|aspx

最後,可以將這個查詢條件儲存起來,方便下次再用

2010年11月9日 星期二

JQuery 取得 asp cehckbox checked

想要針對某個<asp:checkbox>被點選時,要alert一些提示訊息

看了幾篇文章試都不成功
最後是用

if ($(".classChktest input[checked=true]").length > 0) {
   //do somethin
}

其中classChktest 是針對這個<asp:checkbox>設置的cssClass

2010年11月4日 星期四

SSMS2008 R2 Recent Servers List

因為有個連線帳號的密碼老是存不起來,每次開一個QUERY都要重打一次密碼,很煩啊..

要如何重設SSMS 2005/2008/2008R2中的連線資訊呢?

參考這篇文章...解決了一個非常煩人的小問題

Clearing the Recent Servers List in SQL Server Management Studio

刪除以下的目錄刪完後再重開SSMS就OK了
SQL Server 2008:
C:\Documents and Settings\<%username%>\Application Data\Microsoft\Microsoft SQL Server\100\Tools\Shell
SQL Server 2005:
C:\Documents and Settings\<%username%>\Application Data\Microsoft\Microsoft SQL Server\90\Tools\Shell

 在windows 7中,路徑已改成(以SQL Server 2008R2為例)

 C:\Users\<%username%>\AppData\Roaming\Microsoft\Microsoft SQL Server\100\Tools\Shell

2010年11月1日 星期一

VS2010 LINQ Stored Procedure

更新某支Stored Procedure, 開啟dbml檔刪除SP,, Server Explore連上DB後,直接拖拉新的SP,
出現這個訊息
The return types for the following stored procedures could not be detected. Set the return type for each stored procedure in the Properties window.

參考這篇...

Error: Unknown Return Type, The return types for the following stored procedures could not be detected….(LINQ).


建議的二種方法都不喜歡.

最後只好手動修改dbml檔的 .designer.cs檔

原本wizard自已產出的code如下
[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.zspTest")]
        public void zspTest([global::System.Data.Linq.Mapping.ParameterAttribute(DbType="SmallInt")] System.Nullable<short> param1,
            [global::System.Data.Linq.Mapping.ParameterAttribute(DbType="SmallInt")] System.Nullable<short> param2,
            [global::System.Data.Linq.Mapping.ParameterAttribute(DbType="Int")] ref System.Nullable<int> rtn)
        {
            IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), param1, param2, rtn);
            rtn = ((System.Nullable<int>)(result.GetParameterValue(2)));
        }

手動改成

[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.zspTest")]
        public int zspTest([global::System.Data.Linq.Mapping.ParameterAttribute(DbType="SmallInt")] System.Nullable<short> param1,
            [global::System.Data.Linq.Mapping.ParameterAttribute(DbType="SmallInt")] System.Nullable<short> param2,
            [global::System.Data.Linq.Mapping.ParameterAttribute(DbType="Int")] ref System.Nullable<int> rtn)
        {
            IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), param1, param2, rtn);
            rtn = ((System.Nullable<int>)(result.GetParameterValue(2)));
            return ((int)(result.ReturnValue));
        }

IIS 網站無法下載中文檔名檔案因為取消高位元字元

 網址+中文檔案名稱方式下載檔案顯示 404 - 找不到檔案或目錄。 但英數字檔案名稱則可下載。 因為設定GCB IIS,其中1項 將高位元字元預設取消勾選了。 27 TWGCB-04-014-0028 要求篩選與其他限制模組 允許高位元字元 這項原則設定決定查詢...