Build SqlConnectionStringBuilder from connection string
Provides a simple way to create and manage the contents of connection strings used by the SqlConnection class.
Property:
- ApplicationName
- AsynchronousProcessing
- AttachDBFilename
- BrowsableConnectionString
- ConnectionReset
- ConnectionString
- ConnectTimeout
- ContextConnection
- CurrentLanguage
- DataSource
- FailoverPartner
- InitialCatalog
- IntegratedSecurity
- IsFixedSize
- IsReadOnly
- LoadBalanceTimeout
- MaxPoolSize
- MinPoolSize
- MultipleActiveResultSets
- NetworkLibrary
- PacketSize
- PersistSecurityInfo
- TransactionBinding
- System.Transactions
- TrustServerCertificate
- TypeSystemVersion
- UserID
- UserInstance
- WorkstationID
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
string conString=@"Data Source=R4R-3EFD13BB468\SQLEXPRESS;
initial catalog=newDatabase;integrated security=true;
Min Pool Size=5;Max Pool Size=15;Connection Reset=True; Connection Lifetime=600;";
protected void Page_Load(object sender, EventArgs e)
{
SqlConnectionStringBuilder sub = new SqlConnectionStringBuilder(conString);
Response.Write("Parsed SQL Connection String Parameters:");
Response.Write(" Database Source = " + sub.DataSource);
Response.Write(" Database = " + sub.InitialCatalog);
Response.Write(" Use Integrated Security = " + sub.IntegratedSecurity);
Response.Write(" Min Pool Size = " + sub.MinPoolSize);
Response.Write(" Max Pool Size = " + sub.MaxPoolSize);
Response.Write(" Lifetime = " + sub.LoadBalanceTimeout);
Response.Write(" Connection Reset = " + sub.ConnectionReset);
}
}
|
No comments:
Post a Comment