No overload for method 'GetDataByClassType'takes '1' arguments

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mucahit ikiz

    No overload for method 'GetDataByClassType'takes '1' arguments

    Can you help me please,
    I have this error message

    "No overload for method 'GetDataByClass Type'takes '1' arguments"



    private void button7_Click(o bject sender, EventArgs e)
    {
    string connString = @"Data Source=.;Initia l
    Catalog=Northwi nd;Integrated Security=True";
    DataClasses1Dat aContext dc = new
    DataClasses1Dat aContext(connSt ring);
    Table<Customerc ustom = dc.Customers;

    // *****This row is wrong,
    dataGridView1.D ataSource =
    GetDataByClassT ype<Customer>(c ustom)();
    //No overload for method 'GetDataByClass Type'takes
    '1' arguments
    }

    public List<TGetDataBy ClassType<T>() where T : class
    {
    string connString = @"Data Source=MUSTAFAC ;Initial
    Catalog=Northwi nd;Integrated Security=True";
    DataClasses1Dat aContext dc = new
    DataClasses1Dat aContext(connSt ring);
    return Enumerable.ToLi st<T>(dc.GetTab le<T>());
    }


  • Alex Meleta

    #2
    Re: No overload for method 'GetDataByClass Type'takes '1' arguments

    Hi Mucahit,

    You have no arguments for the method GetDataByClassT ype<T>() but provide
    the value 'custom' instead. Either add the argument to the arguments list
    'public List<TGetDataBy ClassType<T>(T t) where T : class' or remove 'custom'
    from calling
    'GetDataByClass Type<Customer>( )()'. Depends

    Regards, Alex Meleta
    mailto:ameleta@ gmail.com; blog:devkids.bl ogspot.com


    Comment

    • Mucahit ikiz

      #3
      Re: No overload for method 'GetDataByClass Type'takes '1' arguments

      Thanks for answer Alex,
      But how can i this method ,

      your script block give me error,

      plaese , send me code block for this method,





      "Alex Meleta" <ameleta@gmail. comwrote in message
      news:df84a49f30 788cab3f2226ca8 e0@news.microso ft.com...
      Hi Mucahit,
      >
      You have no arguments for the method GetDataByClassT ype<T>() but provide
      the value 'custom' instead. Either add the argument to the arguments list
      'public List<TGetDataBy ClassType<T>(T t) where T : class' or remove
      'custom' from calling 'GetDataByClass Type<Customer>( )()'. Depends
      >
      Regards, Alex Meleta
      mailto:ameleta@ gmail.com; blog:devkids.bl ogspot.com
      >
      >

      Comment

      • Alex Meleta

        #4
        Re: No overload for method 'GetDataByClass Type'takes '1' arguments

        Hi Mucahit,

        Which one? I gave you both. Actually your method GetDataByClassT ype<T>()
        doesn't have an arguments but you try to provide custom. As example solution:

        dataGridView1.D ataSource = GetDataByClassT ype<Customer>() ;

        Regards, Alex Meleta
        mailto:ameleta@ gmail.com; blog:devkids.bl ogspot.com


        Comment

        Working...