This is a migrated thread and some comments may be shown as answers.

Sample Data

1 Answer 39 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Lone
Top achievements
Rank 1
Lone asked on 20 Feb 2010, 07:59 PM
This attracted me the most since my application will rely heavily on data and it is hard to manually code test data for a program prototype. However, I do not see any code samples depicting how I would go about using or implementing this sample data. Can you gove me a few guidelines.

1 Answer, 1 is accepted

Sort by
0
Accepted
Rossen Hristov
Telerik team
answered on 22 Feb 2010, 09:14 AM
Hi Lone,

You can use the AdventureWorks or Chinook sample databases provided from Microsoft. They provide quite realistic sample data, i.e. there are tables with huge amounts of records, there are master-details relationships, etc. In other words, they try to cover almost all real-life project scenarios that could exist. Of course, sample data is sample data, there might be real-life project which are much more complex.

Alternatively you can create dummy data in memory on the fly in any possible way that you need. There are no a rules or guidelines on how to create sample data (or examples).

This is just .NET source code. You can create sample data in infinite number of ways, for example:

public static IEnumerable<Customer> GetSampleData(int count)
{
    return from index in Enumerable.Range(1, count)
           select new Customer
                      {
                          Age = index,
                          Boolean = Convert.ToBoolean(index % 2),
                          Name = "Customer " + index,
                          JobCode = index,
                          RegistrationDate = DateTime.Today
                      };
}

Or anything else that you might need.

I hope this helps.

Best wishes,
Ross
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
General Discussions
Asked by
Lone
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or