Web config connection?
-
Hi, I write connection coding in Web config file. The code is When i called it in the web form as con = new SqlConnection(ConfigurationManager.ConnectionString["conn"].ConnectionString); the following error appears. 'System.Configuration.ConfigurationManager' does not contain a definition for 'ConnectionString' Can any one tell whats the error?
-
Hi, I write connection coding in Web config file. The code is When i called it in the web form as con = new SqlConnection(ConfigurationManager.ConnectionString["conn"].ConnectionString); the following error appears. 'System.Configuration.ConfigurationManager' does not contain a definition for 'ConnectionString' Can any one tell whats the error?
Hi, You have not posted the code you wrote in Web.config file. Secondly Please note and correct the syntax for accessing the connection string from web config in C#
con = new SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ConnectionString);
Thanks Padmanabh
-
Hi, I write connection coding in Web config file. The code is When i called it in the web form as con = new SqlConnection(ConfigurationManager.ConnectionString["conn"].ConnectionString); the following error appears. 'System.Configuration.ConfigurationManager' does not contain a definition for 'ConnectionString' Can any one tell whats the error?
con = new SqlConnection(ConfigurationManager.ConnectionString["conn"].ConnectionString);
This code contain two 'ConnectionString', So error appears does not contain a definition for 'ConnectionString' it's right:con = new SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ConnectionString);
-
Hi, I write connection coding in Web config file. The code is When i called it in the web form as con = new SqlConnection(ConfigurationManager.ConnectionString["conn"].ConnectionString); the following error appears. 'System.Configuration.ConfigurationManager' does not contain a definition for 'ConnectionString' Can any one tell whats the error?