Advertisement

07.23.2008 at 11:31PM PDT, ID: 23591146
[x]
Attachment Details

Trying to connect to an SQLEXPRESS database

Asked by tdiscover in Programming for ASP.NET, SQL Server 2005

Tags: Microsoft, Visual Web Developer, 2005, Using 2005 as I need to code for ASP 2.0, ASP.net 2.0, C#, An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB;'.

I keep getting the error "An OLE DB Provider was not specified in the ConnectionString.  An example would be, 'Provider=SQLOLEDB;'." When I add "Provider=SQLOLEDB;" to my connection string it gives me an unknown error. What I don't get is that I got my connection string from visual web developer 2005 by adding a database using the wizard and then copying the connection string it provided - I also tested this connection in the wizard and it said it was fine. I have attached a snippet of the code I am using to connect to the database and here is the code that is in my web.config file:

<connectionStrings>
    <add name="TD_HOLIDAYSNT_LIVE" connectionString="Data Source=BAA02662\SQLEXPRESS;Initial Catalog=TD_HOLIDAYSNT_LIVE;Integrated Security=True"/>
  </connectionStrings>

I must admit I'm not familiar with setting up databases and creating connection strings, and it wouldn't surprise me one bit if someone here told me that I should be putting in a different provider or something silly like that.

Thanks everyoneStart Free Trial
1:
2:
3:
4:
5:
6:
7:
string connectionString = ConfigurationManager.ConnectionStrings["TD_HOLIDAYSNT_LIVE"].ConnectionString;
 
OleDbConnection myConnection = new OleDbConnection(connectionString);
myConnection.Open();
 
OleDbCommand myCommand = new OleDbCommand();
myCommand.Connection = myConnection;
 
Loading Advertisement...
 
[+][-]07.24.2008 at 01:10AM PDT, ID: 22076941

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.24.2008 at 01:10AM PDT, ID: 22076945

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.24.2008 at 02:12AM PDT, ID: 22077213

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Programming for ASP.NET, SQL Server 2005
Tags: Microsoft, Visual Web Developer, 2005, Using 2005 as I need to code for ASP 2.0, ASP.net 2.0, C#, An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB;'.
Sign Up Now!
Solution Provided By: anuragal
Participating Experts: 3
Solution Grade: B
 
 
[+][-]07.24.2008 at 04:15PM PDT, ID: 22084565

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628