Keyword not supported: 'provider' with SqlBulkCopy

asp.net c# ms-access sqlbulkcopy vb.net

Question

I try to write access connection string in SqlBulkCopy but I got error Keyword not supported: 'provider'

here is my code:

bulk = New SqlBulkCopy("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & mFileName & ";Jet OLEDB:Database Password=hmis;")
bulk.DestinationTableName = "Advance"
bulk.WriteToServer(dt_table)
1
0
5/19/2014 11:41:51 AM

Accepted Answer

SqlBulkCopy only works with SQL Server. The constructor you are trying to call, SqlBulkCopy(string) expects a valid connection string for SQL Server. The connection string you passed works only with Access.

Different databases products have different mechanisms for bulk import operations. You can't use a class created for one database product to import data to another.

Microsoft Access has no bulk import support.

2
5/19/2014 11:33:29 AM

Popular Answer

The SQLBulkCopy Class is only supported with SQL Server connection string. You can't use other types of Connection Strings..



Related Questions





Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow