public static DataTable SelectSqlReturnTable(string sql, CommandType type, SqlParameter[] pars)
      {
          SqlConnection con = new SqlConnection(ConnString);
          SqlDataAdapter sda = new SqlDataAdapter(sql, con);
          sda.SelectCommand.CommandType = type;
          if (pars != null && pars.Length > 0)
          {
              foreach (SqlParameter p in pars)
              {
                  sda.SelectCommand.Parameters.Add(p);
              }
          }
          DataTable dt = new DataTable();
          sda.Fill(dt);
          return dt;
      }

相关文章:

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