2014年7月23日 星期三

取出SQL 的Table名稱

                    Dim tablename As String = ""
                    Dim a As Char = " "
                    Dim split1 As String = DtDirectAccess.Rows(i)("SqlStatement")
                    split1 = split1.ToUpper
                    Dim split2 As String() = split1.Split(a)
                    For j As Integer = 0 To split2.Length - 1 Step 1
                        Dim Str1 As String = split2(j)
                        If Str1 = "FROM" Then
                            tablename = split2(j + 1)
                        End If
                    Next

沒有留言:

張貼留言