static void Main(string[] args)
        {
        private static readonly string sqlconnection ="";
//遍历循环client表 IList<Clients> StuList; using (var connection = new System.Data.SqlClient.SqlConnection(sqlconnection)) { connection.Open(); StuList = connection.Query<Clients>("select Prefix from Clients").ToList(); connection.Close(); } var conn = new System.Data.SqlClient.SqlConnection(sqlconnection); conn.Open(); try { int i = 1; foreach (Clients item in StuList) { var file = Environment.CurrentDirectory + "\\sql.txt"; var sql = System.IO.File.ReadAllText(file); sql = sql.Replace("{t}", item.Prefix); int result = conn.Execute(sql); Console.WriteLine("建立表--"+i+"----"+ item.Prefix+"_QueryLog"); i = i + 1; } } catch (Exception ex) { Console.WriteLine(ex.Message); } conn.Close(); Console.ReadLine(); }

 

相关文章:

  • 2021-09-06
  • 2022-12-23
  • 2021-11-06
  • 2021-08-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-20
  • 2022-12-23
  • 2021-10-05
  • 2022-01-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案