string path1 = HttpContext.Current.Server.MapPath("~/install/1.sql");
string path2 = HttpContext.Current.Server.MapPath("~/install/2.sql");
string[] strpath ={ path1, path2 };
for (int i = 0; i < strpath.Length; i++)
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["sqlData"].ConnectionString);
System.IO.StreamReader reader = new System.IO.StreamReader(strpath[i], System.Text.Encoding.GetEncoding("gb2312"));
string st = reader.ReadToEnd();
SqlCommand com = new SqlCommand(st, con);
using (con)
{
con.Open();
com.ExecuteNonQuery();
}
}