<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="Default"%>
Connection String Builders
File: Default.aspx.cs
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Default : System.Web.UI.Page {
protected void CreateButton_Click(object sender, EventArgs e) {
string serverName = SourceName.Text;
string userid = UID.Text;
string pswd = Pwd.Text;
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
builder.DataSource = serverName;
builder.UserID = userid;
builder.Password = pswd;
NewConnString.Text = builder.ConnectionString;
}
}