How to Get Server name, Database name, User name, Password from web.config file in C#
System.Data.Common.DbConnectionStringBuilder
builder = new System.Data.Common.DbConnectionStringBuilder();
builder.ConnectionString =
ConfigurationManager.ConnectionStrings["inventoryDBConnection"].ConnectionString;
;
string server = builder["Data
Source"] as string;
string database = builder["Initial
Catalog"] as string;
string UserID = builder["User ID"] as
string;
string password = builder["Password"]
as string;
Thanks For read this Article
Comments
Post a Comment