日期:2014-05-20 浏览次数:20607 次
protected void Button1_Click(object sender, EventArgs e)
{
if (CeShi())//这是测试下输入的是否正确
{
if (txtDatabaseName.Text.Trim()=="kj249")
{
try
{
string name=DbSqlHelper.kj249();//这个是dbsqlhelp帮助类里方法、返回连接字符串
if (name != null&&name!="")
{
Session["Name"] = "kj249";
lblShow.Text = string.Format("<span style=color:Red;font-size:20px>数据库切换成功</span>");
Response.Redirect("setup.aspx");
}
}
catch (Exception ex)
{
lblShow.Text = string.Format("<span style=color:Red;font-size:20px>数据库切换失败</span>");
lblSql.Text = ex.Message;
}
}
else
{
try
{
string name=DbSqlHelper.boram_web();
if (name != null && name != "")
{
Session["Name"] = "boram";
lblShow.Text = string.Format("<span style=color:Red;font-size:20px>数据库切换成功</span>");