Home Keyword Not Supported: Provider
Reply: 0

Keyword Not Supported: Provider

user854 Published in March 23, 2018, 10:38 pm

I realize there's similarly titled posts here, I've searched through all of them without finding my solution.

I'm uploading an Excel file to SQL Server in ASP.net MVC. Here's my connection string:

<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\aspnet-WebApplication12-20180107114522.mdf;Initial Catalog=aspnet-WebApplication12-20180107114522;Integrated Security=True;" providerName="System.Data.SqlClient" />

And here's my Excel file connection string:

string constr = string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=\"Excel 12.0 Xml;HDR=YES;IMEX=1\";", filepath);

The rest of my code uses SqlConnection / SqlCommand etc, rather than oleDB commands.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.301843 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO