0

I'm trying to import data from Text file to Sql Server; I was getting the error

... path not found.

After I changed the provider , I got the error

The 'Microsoft Text Driver Data Source=C:\CETS\genset_20090110_0511.TXT'  
provider is not registered on the local machine.

I used the following code:

$string strconn2 = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" 
+ p_Excel_Path2 + ";Extended Properties='text;HDR=Yes;FMT=tab'";

and also have tried this too:

string strconn1 = "Provider=Microsoft Text Driver (*.txt)" + "Data Source=" 
+ p_Excel_Path1 + ";Extensions=txt";

but I am getting the same error.

  • Where is this code? I don't think that `$string `... is valid C#... – Abe Miessler May 04 '12 at 06:09
  • what format is your text file in? Not that it matters but if it's a CSV [look here](http://stackoverflow.com/questions/4569833/microsoft-text-driver-or-microsoft-jet-oledb-4-0) Additional [info](http://stackoverflow.com/questions/1991643/microsoft-jet-oledb-4-0-provider-is-not-registered-on-the-local-machine) Hope this helps. Regards. – Codehelp May 04 '12 at 06:08

0 Answers0