CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> .NET

 changing sql statment using datasource

Print topic Send  topic

Author Message

Posts: 30
Posted: 03/03/2004, 1:27 PM

I have checked the following docs for datasource info :

In .NET, datasource doesnt seem to provide an option to change the select clause (you can change the where clause though), is there?

Second, once you get the recordset from the buildbeforeselect SQL, is there a way to intercept it and change the values items. Something similar to this example:

DataRowCollection newDr = Select.Execute().Tables[0].Rows;
for(int i = 0; i < newDr.Count; i++){
UserName = newDr["emp_name"].ToString();
WorkPhone = newDr["phone_work"].ToString();

Except- a) how do you intercept it (i.e. which event)
b) how do you refer to that collection (since the select has already executed in beforebuildselect)

View profile  Send private message

Posts: 5971
Posted: 03/04/2004, 12:41 PM

Here is what I found out:
1. You can modify the SQL in the Before Build or Before Execute Select event using the code:
((TableCommand)Select).SqlQuery = new StringBuilder("select top 3 * from ages"); 
2. You can obtain and modify the DataSet Rows collection in the After Execute Select event, like:
If(E != null){  
        DataRowCollection Rows = dr=ds.Tables[0].Rows;   
        foreach(DataRow row in Rows)   
                row["UserName"] = "NewName";   

Peter R.
YesSoftware Forums Moderator
For product support please visit
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

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login

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