CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.

YesSoftware Forums -> CodeCharge Studio -> .NET

 access grid datasource

Print topic Send  topic

Author Message

Posts: 6
Posted: 02/26/2009, 2:21 PM

How can i access the Datasource of a grid in .Net?
I need sql string whith where condition and sort order
i want to export grid's data to excel without any formating (not as shown in example pack)
View profile  Send private message

Posts: 38
Posted: 03/02/2009, 3:31 AM


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)
View profile  Send private message

Add new topic Subscribe to topic   

These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

Web Database

Join thousands of Web developers who build Web applications with minimal coding.

Home   |    Search   |    Members   |    Register   |    Login

Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by  and YesSoftware, Inc.