akhan
Posts: 38
|
Posted: 03/02/2009, 3:31 AM |
|
HI,
In the before execute select add the following code, which will store the SQL query into a session variable:
Dim SelectStr As String = Select_.ToString()
Dim TempLen As Integer = Len(SelectStr)
Dim TempPos As Integer = InStrRev(SelectStr, "FROM", -1, 1)
If TempPos > 0 Then SelectStr = Right(SelectStr, TempLen - (TempPos + 4))
If TempPos = 0 Then SelectStr = ""
TempPos = InStr(1, SelectStr, "ORDER BY", 1)
If TempPos > 0 Then SelectStr = Left(SelectStr, TempPos - 1)
System.Web.HttpContext.Current.Session("sql_code") = Trim(SelectStr)
_________________
"Simplicity is the key to brilliance” (bruce lee) |