//执行存储过程和普通SQL语句的区别:
1. CommandTex = "过程名"
2.CommandType = CommandType.StoredProcedure


//下面是具体的实现方法:
SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["add"]);
SqlDataAdapter myCommand = new SqlDataAdapter("你的存储过程名",myConnection);
myConnection.Open();
myCommand.SelectCommand.CommandType =   CommandType.StoredProcedure; 
myCommand.SelectCommand.Parameters.Add("@Team_Name",System.Data.SqlDbType.VarChar,50);
myCommand.SelectCommand.Parameters["@Team_Name"].Value = Team_Name ;  //加参数
myCommand.Fill(ds,"result");

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2022-01-01
猜你喜欢
  • 2021-12-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案