CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> .NET

 access grid datasource

Print topic Send  topic

Author Message
kristiano

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
eg
i want to export grid's data to excel without any formating (not as shown in example pack)
View profile  Send private message
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)
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 http://support.yessoftware.com.

Web Database

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

Home   |    Search   |    Members   |    Register   |    Login


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