Tuesday 8 November 2011

How to break the connection string into elements

Question Received:
        How to split the connection string into individual elements
like InitialCatalog, DBName, UserName, Passwd..

Solution:
       To break the conn. String, use the SQLConnectionBuilder as,
        SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder("");
        builder="AnyConnectionString";
        String DBName = builder.IntialCatalog.ToString();

No comments:

Post a Comment