Thursday, 14 June 2012

Get Datasource,Username,Password from Connection String


string conString = "SERVER=localhost;DATABASE=db;UID=root;PASSWORD=test;";
                SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(conString);
                string user = builder.UserID;
                string pass = builder.Password;
                string datasource = builder.DataSource;

No comments:

Post a Comment