Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to convert this code to .NET
Message
From
28/09/2011 13:21:39
John Baird
Coatesville, Pennsylvania, United States
 
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01525046
Message ID:
01525076
Views:
71
>>Hi friend :
>> I have the following code in Foxpro and now, could you please show me how to convert it to .NET language ?
>>
>>create cursor v_templetA( date d, product_code c(15),product_name c(50))
>>create cursor v_templetB( date d, product_code c(15),product_name c(50),grpcode c(15),grpname c(50))
>>
>>select v_templetA
>>append from dbf('v_templetB')
>
>You should not think in VFP terms when working with .NET
>The nearest equivalent would be something like:
DataTable v_templateA = new DataTable();
>            v_templateA.Columns.AddRange( new DataColumn[]{ _
>                new DataColumn("date",typeof(DateTime)), _
>                new DataColumn("product_code", typeof(String)), _
>                new DataColumn("product_name",typeof(String))} _
>                );
>            v_templateA.Columns["product_code"].MaxLength = 15;
>            v_templateA.Columns["product_name"].MaxLength = 50;
>
>            DataTable v_templateB = v_templateA.Copy();
>            DataColumn dc1 = new DataColumn("grpcode",typeof(String));
>            dc1.MaxLength = 15;
>            v_templateB.Columns.Add(dc1);
>            DataColumn dc2 = new DataColumn("grpname", typeof(String));
>            dc2.MaxLength = 50;
>            v_templateB.Columns.Add(dc2);
But this is almost certainly not the approach you would take.....


Its the append from dbf that is the problem...

I had a small sample prepared with a class, a list of that class and a loop... but decided not to post it.... he needs to understand more about .net inorder to do what he wants....
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform