只为成功找方向,不为失败找借口

每天都不能停止前进的脚步
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
        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;
        }