Reading connection string from my App.Config file

  • Thread starter Thread starter Alex Meleta
  • Start date Start date
A

Alex Meleta

Hi Abul,

You need some sort of System.Configuration.ConfigurationManager.ConnectionStrings["Containers.Properties.Settings.Custom_JobConnectionString"]


Regards, Alex Meleta
mailto:[email protected]; blog:devkids.blogspot.co
 
Hello

This is my first post to this group. I just want to ask that how will I read
my connection string from the app.config file in C# 2008 and .Net 3.5. I
tried to use System.Configuration namespace but I think missing something.

here is my app.config file

-----------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add
name="Containers.Properties.Settings.Custom_JobConnectionString"
connectionString="Data Source=196.3.3.3;Initial
Catalog=Custom-Job;User ID=sa;Password=altsds"
providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
-------------------------------------------------------------------------------------------------------------------

Thanks in Advance


Abul Hasan Lakhani.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top