string sqlConnectionString = txtConstring.Text; //connection string FileInfo file = new FileInfo(path + "Procedure_fn.sql"); //*.sql file path string script = file.OpenText().ReadToEnd(); SqlConnection conn = new SqlConnection(sqlConnectionString); Server server = new Server(new ServerConnection(conn)); server.ConnectionContext.ExecuteNonQuery(script);
|