Hello All
I am relatively new to C# and also database programming in general. I thought that the best way to get off the ground would be to write a small database application.
I want to try and write a small database application that manages the following aspects of a small business.
1.) Quoting
2.) Invoicing
3.) Debtors
4.) Contacts
The business is a serviced based business so there is no need for stock management etc.
I want to try and use MySql and C# express 2010.
The concept of how the database tables should be structured and related etc, is not a problem. The main problem is how to model the problem in C#. IOW Can anyone give me some advice as to how to what the class hierarchy should look like.
I am thinking that there will be one base class that manages the database connection and all transactions. This could be an abstract class or maybe an interface (although I am not sure I have the concept of interfaces down just yet). All other classes (one for debtors, one for invoices etc, etc.) will inherit from this base class.
Is this a workable solution or does anyone have a correct / better suggestion.
Any advice on some reading material would also be much appreciated.
Thanks in advance
Rob
Database application model
Page 1 of 14 Replies - 231 Views - Last Post: 10 August 2012 - 11:35 AM
Replies To: Database application model
#2
Re: Database application model
Posted 10 August 2012 - 11:09 AM
You can use a base class if you have columns each of your tables have in common. Otherwise each class will mirror a table's column structure.
#3
Re: Database application model
Posted 10 August 2012 - 11:10 AM
Let me just throw an idea out there: use Sql Server Express (instead of MySql) and use Entity Framework for all your database interaction. It'll build all the classes and contexts you need. EF (or Linq to SQL) are called ORMs. They map your database structure to C# classes. It works quite well. Basically, you're talking about rolling your own. Why not try one that already comes with .NET?
#4
Re: Database application model
Posted 10 August 2012 - 11:27 AM
Entity Framework also works with MySql: http://dev.mysql.com...ata-source.html
Or if you never have to build reports from the SQL database, why even bother using an ORM. Use an object oriented database from the get go: Db4o, VelocityDB, RavenDB, etc.
(Yes, technically RavenDB is a "document" database, but it seems like people are adopting it and using it like a object database.)
Or if you never have to build reports from the SQL database, why even bother using an ORM. Use an object oriented database from the get go: Db4o, VelocityDB, RavenDB, etc.
(Yes, technically RavenDB is a "document" database, but it seems like people are adopting it and using it like a object database.)
#5
Re: Database application model
Posted 10 August 2012 - 11:35 AM
Oh, I know EF works w/ MySql. I just don't like MySql. Sql Express is free, and IMO easier to use, and just as powerful, if not moreso.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|