Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 540767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:16:27+00:00 2026-05-13T10:16:27+00:00

I need to build two objects: an OrderList and an Order. Using those two

  • 0

I need to build two objects: an OrderList and an Order.

Using those two objects, I have to populate a DataGridView with a history of the orders. However, I am instructed not to use binding sources for the connection or other drag and drop controls. Unfortunately, from Google it seems like those are the most popular options for this type of problem.

Can anyone point me in the right direction? I don’t have much experience with C#.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T10:16:27+00:00Added an answer on May 13, 2026 at 10:16 am

    You could to create an Order class:

    public class Order
    {
        public int OrderID { get; set; }
        public DateTime OrderDate { get; set; }
    }
    

    Read your database records and load your orders collection

    List<Order> orders = new List<Order>();
    using(SqlConnection cn = new SqlConnection("..."))
    using (SqlCommand cm = cn.CreateCommand())
    {
        cn.Open();
        cm.CommandText = "SELECT OrderId, OrderDate FROM Orders";
        SqlDataReader dr = cm.ExecuteReader();
        while (dr.Read())
        {
            orders.Add(new Order()
            {
                OrderId = dr.GetInt32(dr.GetOrdinal("OrderId")),
                OrderDate = dr.GetDateTime(dr.GetOrdinal("OrderDate"))
            });
        }
    }
    

    About GridView part, you should take a look into ASP.NET data binding overview

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 303k
  • Answers 303k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Try increasing or removing the timeout, and set read's size… May 13, 2026 at 8:35 pm
  • Editorial Team
    Editorial Team added an answer You need to use HAVING, not WHERE. The difference is:… May 13, 2026 at 8:35 pm
  • Editorial Team
    Editorial Team added an answer The fat comma isn't a special hash assignment operator. It… May 13, 2026 at 8:35 pm

Related Questions

I need to build a rule-based system that can be run and developed in
I am building a game in Visual Studio 2008 and in order to build
Great site! I have a question I haven't seen answered. I am very new
Sorry for the wall of text guys but this one requires expliaining, way too
I'm looking for a Java library for SWIFT messages. I want to parse SWIFT

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.