Hello,

I have a general C# question about interfaces and their derived classes.
I've been pulling my hair out on this.  How is the function
CreateParameter in Command supposed to be defined?

I have provided the code below.

// TestParameterReturnType.cs
//
// Test case to get "does not implement interface member ... either
//   static, not public, or has the wrong return type"

using System;

namespace MyStuff
{
        interface IParameter
        {
                string ParameterName{get;set;}
        }

        public class Parameter : IParameter 
        {
                private string parmName = null;

                public string ParameterName 
                {
                        get 
                        {
                                return parmName;
                        }

                        set 
                        {
                                parmName = value;
                        }
                }
        }

        interface ICommand
        {
                IParameter CreateParameter();
        }

        public class Command : ICommand
        {
                public Parameter CreateParameter()
                {
                        Parameter parm = new Parameter();
                        return parm;
                }
        }

        class MainDriver
        {
                [STAThread]
                static void Main(string[] args)
                {
                        SqlCommand cmd = new SqlCommand();              
                }
        }
}




_______________________________________________
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to