使用存储过程返回一个数据集,SqlCommand -〉SqlDataAdapter -〉DataSet 

        SqlConnection userConnection = Connection.getConnection();
        SqlCommand userCommand = new SqlCommand("storepname", userConnection);
        userCommand.CommandType = CommandType.StoredProcedure;//采用存储过程
        userCommand.Parameters.Add("@pa", SqlDbType.VarChar, 50);//存储过程参数
        userCommand.Parameters["@pa"].Value = pa;//给参数赋值
        userCommand.Connection.Open();
        SqlDataAdapter adapter = new SqlDataAdapter(userCommand);
        DataSet ds = new DataSet();
        adapter.Fill(ds); 
  
      各位博友有什么好的的方法可以发到评论中去!

相关文章:

  • 2022-12-23
  • 2021-12-10
  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-09
  • 2021-10-09
  • 2022-12-23
  • 2022-12-23
  • 2021-11-05
  • 2021-12-23
相关资源
相似解决方案