UWInfo Blog
發表新文章
[Join] | [忘記密碼] | [Login]
搜尋

搜尋意見
文章分類-darren
[所有文章分類]
  • ASP.NET (24)
  • ASP.NET2.0 (4)
  • ASP.NET4.0 (13)
  • JavaScript (17)
  • jQuery (5)
  • FireFox (2)
  • UW系統設定 (2)
  • SQL (7)
  • SQL 2008 (3)
  • mirror (0)
  • SVN (2)
  • IE (3)
  • IIS (6)
  • IIS6 (0)
  • 閒聊 (1)
  • W3C (4)
  • 作業系統 (3)
  • C# (14)
  • CSS (0)
  • FileServer (0)
  • HTML 5 (7)
  • CKEditor (0)
  • UW.dll (9)
  • Visual Studio (2)
  • Browser (2)
  • SEO (0)
  • Google Apps (1)
  • 網站輔助系統 (1)
  • DNS (0)
  • SMTP (3)
  • 網管 (5)
  • 社群API (3)
  • SSL (1)
  • App_Inventor (0)
  • URLRewrite (1)
  • 開發工具 (2)
  • JSON (0)
  • Excel2007 (0)
  • 試題 (0)
  • LINQ (0)
  • bootstrap (0)
  • Vue (0)
  • IIS7 (2)
  • foodpanda (0)
  • 編碼 (0)
  • 資安 (3)
  • Sourcetree (0)
  • MAUI (0)
  • CMD (0)
  • my sql (1)
所有文章分類
[darren的分類]
  • ASP.NET (48)
  • ASP.NET2.0 (15)
  • ASP.NET4.0 (34)
  • JavaScript (49)
  • jQuery (26)
  • FireFox (4)
  • UW系統設定 (3)
  • SQL (39)
  • SQL 2008 (25)
  • mirror (4)
  • SVN (4)
  • IE (9)
  • IIS (20)
  • IIS6 (1)
  • 閒聊 (7)
  • W3C (6)
  • 作業系統 (9)
  • C# (24)
  • CSS (12)
  • FileServer (1)
  • HTML 5 (11)
  • CKEditor (3)
  • UW.dll (13)
  • Visual Studio (16)
  • Browser (8)
  • SEO (1)
  • Google Apps (3)
  • 網站輔助系統 (4)
  • DNS (5)
  • SMTP (4)
  • 網管 (11)
  • 社群API (3)
  • SSL (4)
  • App_Inventor (1)
  • URLRewrite (2)
  • 開發工具 (6)
  • JSON (1)
  • Excel2007 (1)
  • 試題 (3)
  • LINQ (1)
  • bootstrap (0)
  • Vue (3)
  • IIS7 (3)
  • foodpanda (2)
  • 編碼 (2)
  • 資安 (3)
  • Sourcetree (1)
  • MAUI (1)
  • CMD (1)
  • my sql (1)
最新回應
  • IIS ARR (reverse proxy) 服務安裝
    ...more
  • UW DB 元件罕見的錯誤
    我之前好像也遇過, 考慮改一下 pg 的程式....more
  • UW DB物件 GetAllDataFromBaseTableWithCache 會嚴重影響效能
    我把它拿掉了....more
  • UW DB物件 GetAllDataFromBaseTableWithCache 會嚴重影響效能
    好, 把它拿掉.....more
  • 使用 facebook JS SDK 的心得筆記
    FB.login 沒有任何反應~ 不知道怎解決...more
  • IIS Server SSL 升級方式
    更新一版 reg 可以變 A...more
  • 防止 event 往上傳的終極方法
    eee...more
  • IIS Server SSL 升級方式
    Cool......more
  • UNT流量異常追蹤紀實
    有做 Request 的來源 IP 分析嗎 ? 說不定會有其它的發現.....more
  • facebook 網頁分享 Debug 模式
    Header 裡面的兩個 tag.. <meta property="og:i...more
標籤
  • AD
  • IndexOf
  • 中文
  • IIS匯出
  • viewstate
  • email
  • 10
  • 追
  • join
  • EN
  • 允許本機登入
  • acheupdate
  • 1
  • entity
  • 有潛在危險 Requ
  • 黑貓
  • Contains
  • a
  • 3128
  • ARR
  • en order b
  • 458
  • -2211
  • 快取
  • clipboard
  • git
  • sourcetree
  • spf
  • 但由於應用程式已經清
  • kill
  • C
  • ms_descrip
  • -1603
  • 608
  • canvas
  • [u2]
  • 186
  • 966
  • 726
  • MSkvKiovQW
  • -3085
  • ef
  • https:www.
  • .
  • for ,
  • UNT
  • �
  • 0 order by
  • response
  • 12
List.Find - 找出 List 裡符合條件的資料
從 List<T> 找出符合條件的資料

        List<DB.Member> listOfMember = new List<DB.Member>()
                { new DB.Member(15), new DB.Member(20), new DB.Member(25), new DB.Member(30) };

        // Exists: 單純看有無符合條件的資料
        bool IsMemberExists = listOfMember.Exists(x => x.Email == "darren@acaciaco.com");
        // FindIndex: 找出第一個符合條件的 index,找不到傳回 -1
        int index = listOfMember.FindIndex(x => x.Email == "darren@acaciaco.com");
        // Find: return 第一個符合條件的object, 找不到傳回 null
        DB.Member objMember = listOfMember.Find(x => x.Email.Contains("acaciaco.com"));
        // FindAll: return 所有符合條件的objects
        List<DB.Member> listOfMember2 = listOfMember.FindAll(x => x.Email.Contains("acaciaco.com"));


VB
Dim listOfMember As New List(Of DB.Member)() From { _
    New DB.Member(15), New DB.Member(20), New DB.Member(25), New DB.Member(30) }

' Exists: 單純看有無符合條件的資料
Dim IsMemberExists As Boolean = listOfMember.Exists(Function(x) x.Email = "darren@acaciaco.com")
' FindIndex: 找出第一個符合條件的 index,找不到傳回 -1
Dim index As Integer = listOfMember.FindIndex(Function(x) x.Email = "darren@acaciaco.com")
' Find: return 第一個符合條件的object, 找不到傳回 Nothing
Dim objMember As DB.Member = listOfMember.Find(Function(x) x.Email.Contains("acaciaco.com"))
' FindAll: return 所有符合條件的objects
Dim listOfMember2 As List(Of DB.Member) = listOfMember.FindAll(Function(x) x.Email.Contains("acaciaco.com"))

darren, 2014/3/26 上午 09:43:39
文章分類:ASP.NET4.0|C#
Bike, candice, darren, Doug, 瞇瞇, Reiko 已閱讀.
意見
Bike say:
2014-03-28 17:28:45
Cool !!
瞇瞇 say:
2014-03-27 14:19:34
OK 改完了測試過執行 28 萬次大概快 1.5 s
瞇瞇 say:
2014-03-27 14:19:34
OK 改完了測試過執行 28 萬次大概快 1.5 s
瞇瞇 say:
2014-03-27 14:19:33
OK 改完了測試過執行 28 萬次大概快 1.5 s
Bike say:
2014-03-27 11:28:53
沒用過 Activator.CreateInstance, 看起來好像很厲害的指令,但是我想

Dim sqlComm As New SqlCommand()
sqlComm.CommandText = Sql
sqlComm.Connection = Conn
Dim reader As SqlDataReader = sqlComm.ExecuteReader()
While reader.Read()
Dim oRec As T = Activator.CreateInstance(Of T)()
For Each columnName As String In htTypeDefinesForRecord.Keys
oRec.SetField(columnName, reader(columnName))
Next
list.Add(oRec)
End While

上面這一段不知道可不可以換成下面這一段:

Dim DT As DataTable = Me.GetQueryDT(xxx, xxx, xxx)
For Each row As DataRow In DT.Rows
Dim oRec As T = Activator.CreateInstance(Of T)()
oRec._row = row
list.Add(oRec)
Next

效率應該會好一點。
瞇瞇 say:
2014-03-26 17:29:07
剛剛commit
Bike say:
2014-03-26 10:46:52
在哪呀 ? http://192.168.2.3:1586/svn/Liberary/trunk/UW/NET40/Record2.vb 是這個 SVN 嗎 ?
瞇瞇 say:
2014-03-26 09:53:21
我在UW 裡頭寫了一個 UW.Record2.getList 的 function
會回傳 List<Record2> 的物件,
有人可以幫我review 嗎?
Comment:
*Nickname:
E-mail:
Blog URL:
  • *意見內容
  • 預覽
#Nickname#
2014/3/26 上午 09:43:39
#CommentContent#
*請輸入驗證碼: 看不懂,換張圖
 
~ Uwinfo ~