in

'method group' but a `type' was expected

Last post 05-09-2008 1:23 PM by yitzchok. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 05-08-2008 4:55 PM

    'method group' but a `type' was expected

    hi,

    I'm trying to exted code generated by Subcommander, when compile I get this errot 

    Description=`Prufer.Data.Db.User.Insert(string, string, System.DateTime, System.DateTime?, int)' is a `method group' but a `type' was expected(CS0118)]

     I don't understand what this means.

    Thanks.

    Filed under: ,
  • 05-08-2008 9:03 PM In reply to

    Re: 'method group' but a `type' was expected

    Can you give some code that you are using

     

    The error means that something requires a type (Like the User class) and you are passing in a method instead.

    If I am I because I am I, and You are You because You are You, then I am I, and you are you. But If I am I because You are You, and You are You because I am I, then I am not I and You are not You. -Rabbi of Kotzk
  • 05-09-2008 1:22 AM In reply to

    Re: 'method group' but a `type' was expected

    Here is the code,, last two options are optional 

    ------- 

    public void Adduser(string name, string pass) { 

    new Db.User.Insert(name,pass,DateTime.Now);

    }

    ---------

    Here is another snippet , Here I'm getting this error `SubSonic.AbstractRecord<Prufer.Data.Db.User>.FetchByQuery(SubSonic.Query)' is a `method group' but a `type' was expected(CS0118)]

    public bool isExist(string uname)
            {
                IDataReader reader= new Db.User.FetchByQuery(new Query("uesr").AddWhere("username",uname));
                int i=reader.RecordsAffected();
                if(i>0)
                    return true;
                else
                    return false;
            }

     

     

     

     

  • 05-09-2008 1:23 PM In reply to

    Re: 'method group' but a `type' was expected

    Something like this

    Active record
    new UserController().Insert(name,pass,DateTime.Now);

     

    Repository Pattern
    User user = new Use();
    user.Name = name;
    user.Password = pass;
    ...
    Db.Insert<User>(user);

    If I am I because I am I, and You are You because You are You, then I am I, and you are you. But If I am I because You are You, and You are You because I am I, then I am not I and You are not You. -Rabbi of Kotzk
Page 1 of 1 (4 items)