[C#]The returned value of DataContext.ExecuteCommand when executing stored procedures.

In our project, SQL scripts(CRUD in specific) are executed using the class “DataContext” in combination with LinqToSQL,
and then of course, when the method “ExecuteCommand” is invoked, the returned value indicates the rows updated.

When the SQL command executed is simply just an INSERT/UPDATE/DELETE, the result is as obvious as ever.
But when it comes to stored procedures, things might not be that simple. 繼續閱讀 “[C#]The returned value of DataContext.ExecuteCommand when executing stored procedures.”

[.NET]取得 Class 中所有的 Enum 並列出它們的 Name 及 Value

我們要如何取得 Class 中「所有的」 Enum 呢?

測試 Class  (VB.NET) 如下,

Public Class classEnumAll

    Enum TypeA As Integer
        A1 = -1
        A2 = 1
        A3 = 2

    End Enum

    Enum TypeB As Integer
        B1 = -1
        B2 = 1
        B3 = 2

    End Enum

    Private prop1 As String
    Public Property NewProperty() As String
        Get
            Return prop1
        End Get
        Set(ByVal value As String)
            prop1 = value
        End Set
    End Property

    Function MyFunc() As Integer

        Return 0
    End Function
End Class

那 Class 中的 Enum 是屬性嗎? 是 Field 嗎?

繼續閱讀 “[.NET]取得 Class 中所有的 Enum 並列出它們的 Name 及 Value”