Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copying a table over the network
Message
From
17/10/2006 08:18:14
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
17/10/2006 06:48:11
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01162466
Message ID:
01162498
Views:
13
>Hi all
>
>Sometimes when I copy tables from the network to a local drive they become corrupted.
>
>Is there any way, from an ADO.Net command, to copy a table using the OLE DB provider? I would imagine this would be safer than simply doing a file copy.
>
>Thanks
>Kev

Kevin,
I have seen that happen once from a win2K to winXP (or another combination that I don't remember exactly).
An OleDbCommand should do what you want. ie:
using System;
using System.Data;
using System.Data.OleDb;

class copyTables
{
  static void Main() {
  string strCn = 
  @"Provider=VFPOLEDB;Data Source=" +
  @"C:\PROGRAM FILES\MICROSOFT VISUAL FOXPRO 9\SAMPLES\northwind\northwind.dbc";
  OleDbConnection cn = new OleDbConnection(strCn);
  cn.Open();
  OleDbCommand cmd = cn.CreateCommand();
  cmd.CommandText = 
  @"select * from customers into table 'c:\temp\customers' database 'c:\temp\myNewDatabase'";
  cmd.ExecuteNonQuery();
  cn.Close(); }
}
PS:Database is optional.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform