//DataSet LOAD方法
        DataSet ds = new DataSet();
        using (SqlConnection con = new SqlConnection("data source=(local);initial catalog=ThreeLayer;persist security info=False;user id=sa;password=11111;workstation id=AIDE-7CE47A35A7;packet size=4096"))
        {
            con.Open();
            using (SqlCommand com = con.CreateCommand())
            {
                com.CommandText = "p";
                com.CommandType = CommandType.StoredProcedure;
                using (SqlDataReader dr = com.ExecuteReader())
                {
                    ds.Load(dr, LoadOption.PreserveChanges, new String[] { "limit", "Message" });
                }
            }

        }
        foreach (DataTable dt in ds.Tables)
        {
            Console.Write("{0}", dt.TableName);
            Console.WriteLine();
            foreach (DataRow dr in dt.Rows)
            {
                Console.Write("{0} - {1}",dr[0],dr[1]);
                Console.WriteLine();
            }
        }

相关文章:

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