.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

Configuration Manager

Posted By: saminathan L     Posted Date: November 04, 2009    Points:2   Category :C#
In asp.net 2.0

below code is working fine for making a connection in web config


web.config
<connectionStrings>
<add name="connectionstring" connectionString="server=.\SQLEXPRESS;database=abc;Integrated security=SSPI;" providerName="System.Data.SqlClient"/>
</connectionStrings>

In C#.NET

string connectionstring = Convert.ToString(ConfigurationManager.ConnectionStrings["connectionstring"].ConnectionString);
SqlConnection con = null;


but in .net 3.5

I'm getting ConfigurationManager does not exist in current context

how to eliminate????or provide me a structure in 3.5

Responses
Author: Amit Mehra             
Posted Date: November 04, 2009     Points: 5   

HI saminathan L,

Yes you are right by default its appSettings is not present in Web.config file..But you can write AppSetting the same way as in .NET Framework 1.1

Thanks
Amit

Thanks,
Amit
Please "Mark As Answer " if this post help you.
Author: Lalij Mer             
Posted Date: January 06, 2010     Points: 5   

try to Add Reference>System.Configuration.DLL

Please Check my answer if you help....
Thank You...

Lalit.


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend