Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ConnectionString Error

Status
Not open for further replies.

MCuthill

Technical User
Jul 19, 2006
669
CA
Hi Everyone,

I am building a webpage using Visual Studio, ASP pages, VB code behind.

I tested the pages by connecting to a MS Access DB, and now I am using a new ConnectionString to the SQL data and get the following error:
An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB;'.

This error occurs on this line of VB Code:
Code:
SqlDataSource1.Update()
I am able to connect to the SQLDB to view the data, but not update any fields.

Here is my ConnectionString information from the Web.Config file:
Code:
<add name="ACU-DRGLibraryConnectionString" connectionString="Data Source=servername;Initial Catalog=Library;Integrated Security=True"
   providerName="System.Data.SqlClient"/>

I am quite new to ASP and unsure what steps to take in resolving this issue.

Thanks,

Mike
______________________________________________________________
[banghead] "It Seems All My Problems Exist Between Keyboard and Chair"
 
When I do, I get the following error:
Unrecognized attribute 'provider'. Note that attribute names are case-sensitive. (W:\In-House Databases\DRG_Library Site\web.config line 18)
What I am at a loss for is that I am no longer using the DB at that location, I am using the one on the SQL server.
(tested to be true, as the data is different on the server)

Line 18 of Web.Config is:
Code:
<add name="ACU-DRGLibraryConnectionString" connectionString="Data Source=ADV01S02;Initial Catalog=ACU-DRGLibrary;Integrated Security=True"
   [b]providerName="System.Data.SqlClient" provider="SQLOLEDB"/>[/b]

The error occurs on this line of code:
Code:
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ACU-DRGLibraryConnectionString %>"
        ProviderName="<%$ ConnectionStrings:ACU-DRGLibraryConnectionString.ProviderName %>"
        SelectCommand="SELECT dbo_Resource.*&#13;&#10;FROM (dbo_LinkResourceCompetency INNER JOIN dbo_Resource ON dbo_LinkResourceCompetency.ResourceID = dbo_Resource.ResourceID) INNER JOIN dbo_Competency ON dbo_LinkResourceCompetency.CompetencyID = dbo_Competency.CompetencyID;"></asp:SqlDataSource>
    &nbsp; &nbsp;&nbsp;

Thoughts?

Thanks,

Mike
______________________________________________________________
[banghead] "It Seems All My Problems Exist Between Keyboard and Chair"
 
If the error is pointing to a file that you are no longer using, then there's a problem somewhere with that. Try searching your project for a reference to that file. If you can't find one, you could try dropping and recreating some of your SqlDataSource's.


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244.
 
I deleted the other connection string in the Web.Config (had previously only commented it out), and found one reference on a different ASP page that was still looking at the Access DB (and relating connectionstring). Thanks for your assistance ca8msn.

Regards,

Mike
______________________________________________________________
[banghead] "It Seems All My Problems Exist Between Keyboard and Chair"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top