Hi I have added name value pair for connection string in the Web.config file as shown below. On my local environment if works file when the file is located within c:\Inetpub\wwwroot\Applicationname\ directory I attempt to access the database in the following
manner and it works on my local environment. Dim dbConnection As System.Data.IDbConnection = New System.Data.OleDb.OleDbConnection(ConfigurationSettings.AppSettings("EventCM_Database")) however I get an error when I use the same files at my ISP. This is the
error message An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB;'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information
about the error and where it originated in the code. Exception Details: System.ArgumentException: An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB;'. I am not understanding to why the application complaints
about OLEDB provider when I am already including it. Thank you,
Actually I found an answer to my question. It was a SIMPLE typo on my part where I had spelled PROVIDER incorrectly as Provier. This was in WEB.CONFIG file. I fixed this typo and my application works like a charm. I am certanily interested in knowing if I can
use Server.MapPath in Web.config file. For now, I hacked to find the physical path name, but I am worried about long term if my ISP change/move my site to a different physical path. Please share your comments Thank you
nkrishna
Member
10 Points
2 Posts
DSN less connection using Web.config file
Jun 29, 2004 04:19 PM|LINK
nkrishna
Member
10 Points
2 Posts
Re: DSN less connection using Web.config file
Jun 29, 2004 06:50 PM|LINK