Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating VFP Systems Tables
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
ASP.NET
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01189955
Message ID:
01190350
Views:
24
Farouk,

>The database used by the current application is SQLserver but I have few system tables in VFP. Now I am updating the system tables using COM and will like to move the COM to native .Net... Can I specifically tell MM that these tables are to use VFP connection strings? Any example?

Yes, you can. You just need to add another set of database settings to your application configuration files. For example:
<databases>
    <add key="Northwind\Connection" value="server=(local);uid=sa;pwd=;database=Northwind;" />
    <add key="Northwind\DataAccessClass" value="DataAccessSql" />
    <add key="MyVfpDatabase\Connection" value="Provider=vfpoledb.1;Data Source=C:\Program Files\Mere Mortals .NET Framework 2005\Samples\VFPData\northwind.dbc" />
    <add key="MyVFPDatabase\DataAccessClass" value="DataAccessOleDb" />
</databases>
This is a little different than what is demonstrated in the MM .NET sample application where you can switch dynamically between a SQL Server and VFP database (with the exact same schema) at run time.

In this case you specify a different database key (in this exanple, "MyVFPDatabase"). In the constructor of business objects that access VFP data, just set the DatabaseKey property to whatever you choose for the database key in the application configuration file. For example:
public MyBusinessObject
{
   this.DatabaseKey = "MyVFPDatabase";
}
Make sure you specify this setting in your business object's app.config file (for when you are testing them standalone) and in your Window Forms app.config file or Web Forms's web.config file.

Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Reply
Map
View

Click here to load this message in the networking platform