kabila
Posts: 30
|
Posted: 03/03/2004, 1:27 PM |
|
I have checked the following docs for datasource info :
http://docs.codecharge.com/studio/html/ProgrammingTec.../ModifySQL.html http://docs.codecharge.com/studio/html/Components/RTP...DataSource.html
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)
thanks
|
|
|
peterr
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 http://support.yessoftware.com |
|
|
|