4 Replies - 505 Views - Last Post: 10 August 2012 - 11:35 AM Rate Topic: -----

#1 navbor  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 10-August 12

Database application model

Posted 10 August 2012 - 10:28 AM

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

Is This A Good Question/Topic? 0
  • +

Replies To: Database application model

#2 jared.deckard  Icon User is offline

  • New D.I.C Head

Reputation: 18
  • View blog
  • Posts: 46
  • Joined: 11-July 12

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.
Was This Post Helpful? 0
  • +
  • -

#3 Curtis Rutland  Icon User is online

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4496
  • View blog
  • Posts: 7,849
  • Joined: 08-June 10

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?
Was This Post Helpful? 1
  • +
  • -

#4 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3589
  • View blog
  • Posts: 11,159
  • Joined: 05-May 12

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.)
Was This Post Helpful? 0
  • +
  • -

#5 Curtis Rutland  Icon User is online

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4496
  • View blog
  • Posts: 7,849
  • Joined: 08-June 10

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.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1