Gautam Buddha Temple Varanasi,Varanasi - Buddhist Pilgrimage

Tuesday, August 24, 2010

How to create connection string dynamically

Here i am using viewstate to create connection string at run time.
 protected void btnSubmit_Click(object sender, EventArgs e)  
{
ViewState["DataScorceName"] = datasource;
ViewState["Customer"] = txtCustomer.Text;
}
public void MyFunction()
{
string sqlConnectionString = "Persist Security Info=True;User ID=sa;Password=Sa;Initial Catalog=" + DBName + ";Data Source='" + ViewState["DataScorceName"] + "'";
}

No comments:

Post a Comment