Error associated with delegate

I am trying to use a delegate which should pass a handle of a method (GenerateLinkCollectionFromReader) in a child class to the parent class however when I try to comple I get the error below and I can't figure out why.  Any help would be appreciated!

============== ERROR =================

Inconsistent accessibility: parameter type 'DataAccessLayer.SqlDataAccessLayer.GenerateCollectionFromReader'
is less accessible than method
'DataAccessLayer.SqlDataAccessLayer.ExecuteReaderCmd(System.Data.SqlClient.SqlCommand, DataAccessLayer.SqlDataAccessLayer.GenerateCollectionFromReader)'

============== CODE SNIPS =============

namespace DataAccessLayer
      delegate CollectionBase GenerateCollectionFromReader(IDataReader returnData);

      public abstract class SqlDataAccessLayer
            public SqlDataAccessLayer()

(132)-->            protected CollectionBase ExecuteReaderCmd(SqlCommand sqlCmd, GenerateCollectionFromReader gcfr)
                  if (strConnectionString == String.Empty)
                        throw new ArgumentOutOfRangeException("strConnectionString");
                  if (sqlCmd == null)
                        throw new ArgumentNullException("sqlCmd");

                  SqlConnection cn = new SqlConnection(this.strConnectionString);

                        sqlCmd.Connection = cn;
                        CollectionBase temp = gcfr(sqlCmd.ExecuteReader());
                        return temp;

            } // End ExecuteReaderCmd

namespace DataAccessLayer

      public class LinkTrackerDataAccessLayer : SqlDataAccessLayer

      public LinkCollection GetLinkByID(int LinkID)
            SqlCommand sqlCmd = new SqlCommand();
            AddParamToSQLCmd(sqlCmd, "@link_id", SqlDbType.Int, 0, ParameterDirection.Input, LinkID);

            SetCommandType(sqlCmd, CommandType.StoredProcedure, SP_LINK_GETLINKBYID);
            GenerateCollectionFromReader sqlData = new GenerateCollectionFromReader(GenerateLinkCollectionFromReader);
            LinkCollection stsCollection = (LinkCollection)ExecuteReaderCmd(sqlCmd, sqlData);
            return stsCollection;
      private CollectionBase GenerateLinkCollectionFromReader(IDataReader returnData)
            // Create new link collection.
            LinkCollection mlsCollection = new LinkCollection();

                  Link newLink = new Link(int.Parse(returnData("link_id")),
            // Return Collction
            return mlsCollection;
      }      // End GenerateLinkCollectionFromReader
           } // End LinkTrackerDataAccessLayer
} // End Namespace
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

moduloConnect With a Mentor Commented:
PAQed with points refunded (500)

Community Support Moderator
Try changing:
   protected CollectionBase ExecuteReaderCmd
   public CollectionBase ExecuteReaderCmd
g9supportAuthor Commented:
Yeah, I tried that and I still get the "blue squiggly" line with the same error.
g9supportAuthor Commented:
Ok, I figured it out and I'm posting it here just in case someone else has the same problem.

The delegate delcaration was outside of the class scope. I moved the delegate declaration into the class and added  the "protected" modifier to the declaration.

BLAMMO! The problem was solved.

(now, onto more debugging... how fun)
g9supportAuthor Commented:
I figured out the problem my self and posted it above. How do I close a question if i figured it out myself?
All Courses

From novice to tech pro — start learning today.