Hi friends..
I have a windows application and have its app.config file in which I added connection string named 'Con'. I am using sql server 2005 enterprise edition and visual studio 2008 professional.
The app.config file is as follows.
="1.0"="utf-8"
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="Con" connectionString="Data Source=JASIL;User ID=sa;Initial Catalog=Lab_DB"
providerName="System.Data.OleDb"/>
</connectionStrings>
</configuration>
and i used the following code to retrieve the connection string
Dbcon = new SqlConnection(ConfigurationManager.ConnectionStrings["Con"].ConnectionString);
but it caused the error - An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB;'.
then i changed it to
="1.0"="utf-8"
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="Con" connectionString="Provider=SQLOLEDB.1;Data Source=JASIL;User ID=sa;Initial Catalog=Lab_DB"
providerName="SQLOLEDB.1"/>
</connectionStrings>
</configuration>
the it shows the error - Keyword not supported: 'provider'.
I dont know what is the error .. Please help me...
Thank You.