C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » WCF »

How to change connection string value not the name of connection string.


Posted Date: 21 Oct 2009      Posted By: deepak arora      Member Level: Bronze     Points: 1   Responses: 1



i do not want to change name of connection string. i want to change value of connection string e.g connectionString="Data Source=.....

-------------------------------
public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config)
{
base.Initialize(name, config);

// Update the private connection string field in the base class.
string connectionString = "Data Source=abc User ID=aspnet ; Password=aspnet;";

// Set private property of Membership provider.
FieldInfo connectionStringField = GetType().BaseType.GetField(connectionString, BindingFlags.Instance | BindingFlags.NonPublic);
connectionStringField.SetValue(this, connectionString);
}





Responses

Author: sajid khan    22 Oct 2009Member Level: SilverRating: 1 out of 5     Points: 1

You can achieve by declaring a variable and that variable will hold the connection string value. So, just have the connection string as:
string connectionString = "Data Source=" + variable +"User ID=aspnet ; Password=aspnet;";



Post Reply
You must Sign In to post a response.
Next : How to implement GetPropertyValues and SetPropertyValues in WCF.
Previous : WCf Vs Webservices
Return to Discussion Forum
Post New Message
Category: WCF

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use