Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP vs .Net Membership
Message
From
27/12/2009 14:07:19
 
 
To
15/11/2009 20:30:40
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01434848
Message ID:
01440778
Views:
117
Thanks for the suggestion. The crux of the problem was how to enter the data into the membership. I have since found the membership API and also the AspNetDB stored procedures which clearly provide the techniques necesswary to load data into an existing membership.

Glenn

>>.Does anyone have any ideas as to how to go about this task? I can program it in VFP or .Net Windows forms.
>
>Glenn
>
>I'm speaking from the perspective of a 20 year XBase programmer with < 6 months C# experience.
>
>I just finished a Win Form C# app that loads a datable with VFP table data using the VFPOLEDB provider and integrates with it with SQL Server data.
>The VFPOLEDB provider is great. In addition to the normal SQL commands. you can use familiar VFP functions like DTOC, EMPTY, ALLTRIM, etc so you can get the data into the datatable exactly the way you want it.
>
>Another solution is to use a Linked server to read the VFP data. I tried that, but in my case the VFPOLDDB provider is several orders of magnitude faster than the Linked server when reading VFP data so I opted to use the provider instead.
>
>Loading the .NET datatable with VFP data is fairly simple and passing the data to the membership class should be easier to do in a Win Form, I'd think, so athough I'm much more comfortable with VFP I'd still opt for a Win Form solution over a VFP solution in this case.
>
>Here's some fairly primitve code that I used to get my feet wet.
>
>The final code doesn't use hardcoded paths, uses try/catch etc, but this will give you an idea how the provider works.
>
>Note the double backslashes in the path string.
>
>
>
>  string meycopath = "c:\\apps\\meyco\\pro60\\data\\";
>
>         string strconn = @"Provider=VFPOLEDB;data source= " + meycopath;
>         OleDbConnection cdconn = new OleDbConnection(strconn);
>
>         string extractsono = "'     35575'";
>         string strloadSomast = " select * from somast01 where sono = " + extractsono;
>         cdconn.Open();
>
>
>         OleDbCommand oCmdLoadSomast = new OleDbCommand(strloadSomast, cdconn);
>
>         DataTable dtSomast = new DataTable();
>         dtSomast.Load(oCmdLoadSomast.ExecuteReader());
>
>         if (dtSomast.Rows.Count > 0)
>         {
>            foreach (DataRow row in dtSomast.Rows)
>            {
>               string sono = row.Field<string>("sono");
>               MessageBox.Show(sono);
>
>            }
>         }
>         else
>            MessageBox.Show("No records were found");
>
>         cdconn.Close();
>
>
Previous
Reply
Map
View

Click here to load this message in the networking platform