Sunday 18 August 2013

C# Connection String

C# Connection String

I am using the following connection string within the node. But somehow,
it seems that it is not saving. Everytime I use
System.Configuration.ConfigurationManager.ConnectionStrings["myDB"].ConnectionString
it has a null value, and when I check the index "0" it points to
.\SQLEXPRESS.
`
<connectionStrings>
<clear/>
<add name="myDB"
providerName="System.Data.SqlClient"
connectionString="Server=Server\Instance;Database=anydb;User
Id=***; Password=***;" />
</connectionStrings>
`
The projects is an ASP.NET MVC 2 project. I really need this to work,
since I am learning the CodeFirst Entity manager Framework. Is there any
sugesion?

No comments:

Post a Comment