Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataTable2Dbf
Message
From
20/02/2004 15:53:25
 
 
To
20/02/2004 12:42:42
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Title:
Miscellaneous
Thread ID:
00879337
Message ID:
00879465
Views:
22
Clayton,

First, let me say that I haven't done this, but I thought I'd give you my opinion. If you want it to be all managed code, then I think your only alternative is the one you're wanting to avoid (inserting each row through the VFP OleDbProvider). I don't know why you think this is a bad thing.

Both of your other suggestions, IMHO, would take much longer to do (both in coding it and in executing it).

~~Bonnie


>Greetings.
>
>I think what I am trying to do is rather simple, but as of now, I have not been able to accomplish it.
>
>I want to save a Ado.Net DataTable created from a SqlDataAdapter as a VFP dbf.
>
>This was easy to accomplish in the previous implementation using Sql Passthrough from fox.
>
>*& Old Way
>lnSuccess = SQLEXEC(nHandle, Select top 1 * from Entities, "cResult")
>IF lnSuccess>0
>        SELECT cResult
>	COPY TO OutputFile.dbf
>ENDIF
>
>
>From .Net, I want to accomplish the same thing through the VFP OLEDB Provider. I am trying to avoid doing a create table and then foreaching each row to do an insert. I just want to send the DataTable to a dbf.
>
>
>DataTable dt = new DataTable();
>SqlCommand cmd = new SqlCommand("Select top 1 * from Entities", sqlconDest);
>SqlDataAdapter da = new SqlDataAdapter(cmd);
>da.Fill(dt);
>
>// of course this won't work....
>//OleDbCommand cmd2 = new OleDbCommand("Select * from (dt) into OutputFile.dbf", oledbcon)
>
>
>My alternatives seem to be either Serializing the DataSet to xml and calling a VFP COM object to parse the xml and create the table (wanted this to be all managed code), or using DTS to create the table, and then copy it from the SQL Server (currently the application server has no connections to sql server).
>
>If anyone else has had to accomplish roughly the same thing, I would sincerely appreciate your input.
>
>TIA
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform