none
There is no argument given that corresponds to the required formal parameter 'OrdersQuery' of 'OrderBusiness.GetTodayOrders(IQueryable)' ProductAppWinforms RRS feed

  • Question

  • This is my method which filters my database to show DateTime only from Date.Time.Today.

     public IQueryable<Order> GetTodayOrders(IQueryable<Order> OrdersQuery)
            {

                var orderfilter = OrdersQuery.Where(o => o.Time >= DateTime.Today && o.Time < DateTime.Today.AddDays(1));

                return orderfilter;
            }

    Here on GetTodayOrders() i got this message

    There is no argument given that corresponds to the required formal parameter 'OrdersQuery' of 'OrderBusiness.GetTodayOrders(IQueryable)' ProductAppWinforms

    Form1.cs

     private void UpdateGrid2()
            {
                dataGridView1.DataSource = orderBusiness.GetTodayOrders();
                dataGridView1.ReadOnly = true;
                dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            }

    Any ideas how to fix it?

    Friday, April 5, 2019 12:45 PM

Answers

  • Hello,

    You are calling GetTodayOrders without passing in OrdersQuery.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Friday, April 5, 2019 1:28 PM
    Moderator

All replies

  • Hello,

    You are calling GetTodayOrders without passing in OrdersQuery.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Friday, April 5, 2019 1:28 PM
    Moderator
  • Hi

    Is your problem solved? If so, please post "Mark as answer" to the appropriate answer, so that it will help other members to find the solution quickly if they face a similar issue.

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, April 8, 2019 2:34 AM
    Moderator