CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2007
    Posts
    11

    invoice program xml or ms access or ...?

    hi,

    I want to make an invoice program in c#. It must be capable to save customers , products and invoices and also capable to make rapports. Should I use xml database or Microsoft access or something else that is better for this kind of programs?

    Any advice is welcome thank you very much

  2. #2
    Join Date
    Nov 2006
    Location
    North Bend, WA
    Posts
    487

    Re: invoice program xml or ms access or ...?

    That's a pretty open question. A lot of it depends on the scale of the problem. If you are talking about a few customers, then maybe an XML file would work. If your database might not fit easily into memory, you should consider a small database engine like SQLExpress. I probably wouldn't use Access at this point.

    The best thing you can do is to try to make your data storage not depend on any specific database, using simple ADO commands to do the access. That way, you can scale up more easily if it becomes an issue.

  3. #3
    Join Date
    Jan 2007
    Posts
    11

    Re: invoice program xml or ms access or ...?

    First off thank you for your reply dcell59. I think i'll use access database. But i don't like to use an external program to make a databse (ms access). Is there an other way to make an acces file in c sharp? (adding tables...)

    Thank you in advance

  4. #4
    Join Date
    Nov 2006
    Location
    North Bend, WA
    Posts
    487

    Re: invoice program xml or ms access or ...?

    You can use ADO objects to create your database and its elements. I haven't done it myself (I usually work with SQL or with datasets in files), but there should be examples.

  5. #5
    Join Date
    Nov 2004
    Location
    Poland
    Posts
    1,355

    Re: invoice program xml or ms access or ...?

    1) Access accepts DDL commands. So U can post DDL scripts to create database, tables, views etc (or copy blank database). And U can connect to it by using JET OLEDB. But it is not a client-server architecture (which has many implications)
    2) Using XML U can do only simple selects. But in the other hand U can create data sets and datat tables form XML and make queries in C#. But it is not a client-server architecture (which has many implications)
    3) U can use client-server database (SQL2005 Express for example). It is scalable, safe and fast solution. U can transfer almost all business logic to stored procedures which allows to change that logic by applying SQL scripts only . U can easy integrate SQL2005 instalation within setup programm.

    Best regards,
    Krzemo.

  6. #6
    Join Date
    Apr 2005
    Posts
    576

    Re: invoice program xml or ms access or ...?

    I think the Jet database engine (Access MDB files) has a few advantages:

    - It does not require any database installation
    - It is quite fast for most single user scenarios
    - It is easy to distribute the database

    So it is ideal for desktop applications requiring a database.

    An Access database file cannot be created directly via ADO .Net, but you can use DAO (I use that) and I think also ADOX to create the database. Once you have created the database you can use DDL like Krzemo said to create tables, views, relations, queries, and indices. I have for instance written code that takes a DataTable and creates the corresponding table in the database.

    You can of course use an Access database in a client-server architecture. But Access is not so scalable, I think one reason is simple locking mechanisms (Access uses page locks I think). So I would go for SQL Server in 2-, 3- and n-tier scenarios.

  7. #7
    Join Date
    Nov 2004
    Location
    Poland
    Posts
    1,355

    Re: invoice program xml or ms access or ...?

    - It does not require any database installation
    No, it does. U have to ensure that many components will be installed on client machines. U have to at least copy database file and configure access path to it, manage permissons, etc.
    SQL Express solutions are not much more complicated in instalation.

    So it is ideal for desktop applications requiring a database.
    Not at all. Since I used to use it a lot, I know how many problems that solution can cause. If it is home application and information stored in it is not vital, than OK. But if U want to have more secure and scalable application than I will not recommend that kind of solution.

    You can of course use an Access database in a client-server architecture.
    Access solutions are not a client-server architecture. Each "client" has its own database engine - it is file based architecture.

    Best regards,
    Krzemo.

  8. #8
    Join Date
    Apr 2005
    Posts
    576

    Re: invoice program xml or ms access or ...?

    Quote Originally Posted by Krzemo
    U have to at least copy database file and configure access path to it, manage permissons, etc.
    Well database file can be created from code, access path can be defined by code, and in a single user scenario perhaps you don't have to bother with permissions (but that depends on the requirements really). I thought that the Jet drivers always are installed as part of Windows - I recall reading this here somewhere - but I am not sure.

    Creating an access database from code requires three lines of code - and a reference to DAO:

    Code:
    DBEngineClass daoEngine = new DBEngineClass();
    DAO.Database daoDB = daoEngine.CreateDatabase(
       filename, 
       DAO.LanguageConstants.dbLangGeneral, 
       DAO.DatabaseTypeEnum.dbVersion40);
    daoDB.Close();
    Quote Originally Posted by Krzemo
    Access solutions are not a client-server architecture. Each "client" has its own database engine - it is file based architecture.
    Yes, Access itself is file based, but you can still build a client-server architecture with it. The Access client can be a server in your architecture, e.g. it can be a component running in a server, and that component in turn can be access by other clients. But still, I would not use Access in a client server architecture.

  9. #9

    Re: invoice program xml or ms access or ...?

    In a first point, basically, your question can be sumarize as "do i use a text file to store my data or a database?" The database solution of course, simply because it will allow to link groups of data one with another. That would be very costly in a Xml data implementation of your solution. Xml won't easily answer the question: "What are this customer invoices?" or "how much does he owe to me?".

    Second point. You should question yourself about the scope of your development. Is it an application made for you only or something that you will sell? If you use a database you have to question yourself about the possibility you have to distribute it. What would be the cost of distributing an Access database? What i can remember from past versions, is that to distribute a program that uses JET, you needed to have a professionnal version of the development sofware you were using, and thus the version of JET was way below any version of Access existing on the market, meaning, your database couldn't be used with Access, unless upgraded. But if upgraded, you would have lose the right to sell it (or additionnaly the users needed to have a registered version of access) because of the highest version of JET. Same problem with MySql. It is free to use outside commercial environment, but distributing requires the payment of fees.

    Last part, how many user will work on your sofware simultaneously? if more then one, them xml should be vanishing from your mind now. Access woudn't be the best solution either, since it is said not very safe to use for that kind of implementation.
    David Domingues at webrickco@gmail.com. Feel free to visit http://www.webrickco.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured