Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where is YAG? What are the reasons?
Message
 
To
03/04/2007 16:33:33
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01210085
Message ID:
01211826
Views:
20
>hope I never have to learn that godawful language. Do you have to type it in that way or is it generated by a GUI builder?
>
>It's just the source of a web page. Can you supply a sample of the sort of source you prefer- are you comparing to an ASP.NET page or West Wind, or to what? If you're using a GUI designer, can we see what it produces? TIA.

Just for comparison:

In .NET:
wwSqlLight DAL = new wwSqlLight();
DataTable table = DAL.ExecuteTable("select * from customers","TCustomers");

this.GridView.DataSource = table;
this.GridView.DataBind();
Manual step through:
foreach(DataRow row in table.Rows)
{
    Response.Write(row["Company"].ToString() + " " + row["Entered"].ToString("d"));
}
Ok, that's cheating - ExecuteTable() is a generic function that hides about 15 lines that's reusable <s>... but by using a data single method access wrapper, but one method with 10 lines of code wrapped like this will basically allow syntax like that.

But you don't even need that - you could use a DataSource control assign a Select statement and use that as a data source and you can do that either in code or visually.

In FoxPro with Web Connection with the Page framework:
select * from Customers into cursor TCustomers

this.dgCustomers.DataSource = "TCustomers"
this.dgCustomers.DataBind()
Assuming you've added a grid to the page.

Manually writing the data of course would be just running the SELECT and:
SCAN
  Response.Write( TCustomers.Company + " " + TRANS(TCustomers.Entered) )
ENDSCAN
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform