DB Provider

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Mar 2007
Posts: 68
Reputation: toadzky is an unknown quantity at this point 
Solved Threads: 0
toadzky toadzky is offline Offline
Junior Poster in Training

DB Provider

 
0
  #1
Aug 11th, 2008
I am trying to use an existing access db file with my c# app. When I try to connect, it says that:
"The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine."

How do I register it/install it/whatever it is I need to do to make it work?

Thanks.

I have Visual Studio 2008 with SQL Server 2005 Express installed if that helps.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 39
Reputation: nvmobius is an unknown quantity at this point 
Solved Threads: 4
nvmobius nvmobius is offline Offline
Light Poster

Re: DB Provider

 
0
  #2
Aug 11th, 2008
www.connectionstrings.com

use it, love it.
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 68
Reputation: toadzky is an unknown quantity at this point 
Solved Threads: 0
toadzky toadzky is offline Offline
Junior Poster in Training

Re: DB Provider

 
0
  #3
Aug 12th, 2008
You realize that the connection string format is not the issue right? I know how to format the string, it just can't find the provider.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 39
Reputation: nvmobius is an unknown quantity at this point 
Solved Threads: 4
nvmobius nvmobius is offline Offline
Light Poster

Re: DB Provider

 
0
  #4
Aug 12th, 2008
Um...

Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;

Or in the case of one system I work on:

Data Source=HQNVSQL07;Initial Catalog=dxBugsDb;User Id=******;Password=******;

This is of course using System.Data.SqlClient.SqlConnection objects.

example:

  1. using ( System.Data.SqlClient.SqlConnection = new System.Data.SqlClient.SqlConnection(@"Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;") ) {
  2. // DO WORK
  3. }

As you can see, if it's SQL Server then you don't need a Provider.
Last edited by nvmobius; Aug 12th, 2008 at 3:41 am. Reason: Added sample code
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 793 | Replies: 3
Thread Tools Search this Thread



Tag cloud for C#
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC