2017年11月22日 星期三

LINQ 筆記

TAKE(取前幾項)、SKIP(跳過前幾項)
https://ithelp.ithome.com.tw/articles/10104729

2017年11月17日 星期五

MVC Attribute Data Annotation 驗證

https://dotblogs.com.tw/mrsunboss/2013/01/03/86688
https://dotblogs.com.tw/harry/2016/07/06/150115
https://stackoverflow.com/questions/6269320/manually-bind-jquery-validation-after-ajax-request

MVC 所有 try catch 放在同一個地方處理

http://www.huanlintalk.com/2013/01/aspnet-web-api-exception-filter.html

概念是new 一個 class 去繼承 exception,然後在app_start裡面config.filter 放進去

2017年11月16日 星期四

Oracle 取 Top 使用 Rownum

Oracle 沒有 Top 1 或是 Limit 語法,是使用 rownum 編號
使用方式如下,在Oracle中,rownum會比group by、order by更先執行,因此要用子查詢

select xxx from (select xxx from xxx order by xxx) where rownum<2

上面那句就是取 TOP 1

2017年11月6日 星期一

Razor 文章暫放

有些東西之後不想花太多時間找,就暫時放這邊吧

把字串用Html方式顯示
https://stackoverflow.com/questions/27284734/render-a-string-as-html-in-c-sharp-razor

Html Helper 擴充函式、TagBuilder 組出 img 的  html tag
http://www.itorian.com/2012/10/html-helper-for-image-htmlimage.html

2017年1月23日 星期一

OO與Testing 的講義連結

順序由上而下 [ASP.NET]91之ASP.NET由淺入深 不負責講座 Day14 – Object Oriented (1) https://dotblogs.com.tw/hatelove/archive/2010/10/15/object-oriented.aspx [物件導向]基礎篇:封裝、繼承、多型 (投影片分享) https://dotblogs.com.tw/hatelove/archive/2012/07/20/object-oriented-training-encapsulation-inheritance-polymorphism-introduction.aspx [物件導向]基礎篇:interface, abstract, 意圖導向設計 (投影片分享) https://dotblogs.com.tw/hatelove/2012/07/23/object-oriented-training-abstract-interface-and-intention-driven-design-introduction [Unit Test Tricks] Extract and Override https://dotblogs.com.tw/hatelove/2015/11/26/unit-test-by-extract-and-override [Unit Test Tricks] Static Setter Injection https://dotblogs.com.tw/hatelove/2015/12/03/unit-test-by-static-setter-injection http://www.netobjectives.com/PatternRepository/index.php?title=TheFacadePattern

2017年1月4日 星期三

Excel 資料連線到 MYSQL SERVER 錯誤

流程: 1.EXCEL需要用ODBC連線到MYSQL SERVER 2.所以需要安裝 MYSQL ODBC (32或64版本是看 office版本) 3.但是安裝時可能會發生找不到檔案的錯誤 ( error 126 ) 4.需要安裝VS2010轉發套件 (32或64版本是看 office版本) 參考文件如下 http://blog.csdn.net/ryu2003/article/details/50587837