so far I’ve never dealed with serious DB programming in “native” languages (I’m using the “native” word here as opposition to web-based languages like PHP, thus I assume C# is one of those “native” languages. Probably I should use different word, but I don’t know any).
Thus I’m looking for a good example of DB application in C#.
This example should show how to:
- add, remove, edit records
- list records
- handle relations
most important for me is to learn the proper way of doing the above things, in example – avoiding loading the whole table to memory (hey, it might have 500 000 records [or more 😉 ])
A good example of what I’m looking for is P4A demo – products catalog.
This however is written in PHP 😉 http://p4a.crealabsfoundation.org/demo/
First, good question because I don’t know of any really good DeskTop/Db sample applications.
You will have to pick a technology first, C# is just the language. You’ve only indicated Desktop, that leaves you with a lot of choices:
More combinations are possible, and there are other (3rd party) ORMs such as NHibernate.
The WinForms+Datasets/DataReaders is the oldest and simplest tech but not very OOP. You will find a lot of small samples and videos on WindowsClient.NET. Don’t overlook the VisualBasic samples.
I will call it very good for small applications, less suitable for larger ones.
The Entity Framework (EF) is newer, lots of (recent) blogging about details. I found one small but rather complete sample on MSDN (but I couldn’t find an accompanying article). Do take a look if you consider an ORM.
Very good for larger applications as it supports better layering and (unit-)testing.