private SqlParameterCollection GetSpParameters(string spName)
{
SqlCommand myCommand = new SqlCommand();
myCommand.CommandText = spName;
myCommand.CommandType = CommandType.StoredProcedure;
myCommand.Connection = new SqlConnection("user id=sa;password=sa;data source=.;persist security info=True;initial catalog=数据库");
myCommand.Connection.Open();
SqlCommandBuilder.DeriveParameters(myCommand);
return myCommand.Parameters;
}
{
SqlCommand myCommand = new SqlCommand();
myCommand.CommandText = spName;
myCommand.CommandType = CommandType.StoredProcedure;
myCommand.Connection = new SqlConnection("user id=sa;password=sa;data source=.;persist security info=True;initial catalog=数据库");
myCommand.Connection.Open();
SqlCommandBuilder.DeriveParameters(myCommand);
return myCommand.Parameters;
}