Database best solution.  
Author Message
plaszlo





PostPosted: Visual C# General, Database best solution. Top

What is the best solution for a program, storing settings, logs...., is it MS Access database file




Visual C#16  
 
 
David L





PostPosted: Visual C# General, Database best solution. Top

I would not recommend Access for a new project. If I were you I'd go with some edition of SQL Server 2005. If it's a rather small project you may be fine with SQL Express. On the other hand, if your database must be able to store several million rows, and have high performance etc etc, you may want to use another edition.

This link provides more information about the differences between the editions of SQL Server 2005: http://www.microsoft.com/sql/prodinfo/features/compare-features.mspx

Did that somewhat clarified it


 
 
Mark Benningfield





PostPosted: Visual C# General, Database best solution. Top

Hello All.

plaszlo:

Well, the "best" solution would depend on what your definition of "best" is.

But, generally speaking, in most cases the most commonly accepted way of storing program settings in C# is by way of configuration files.

For logging information, it depends on what format you need the logs to be in. One common method is to write to the application's event log, by way of the System.Diagnostics.EventLog class. However, it is conceivable that a good solution would involve writing log information to a database file, depending on how you intended to use that information later.

There are all kinds of considerations that go into deciding to use one solution over another. Primarily, though, if a solution does not meet your needs, then it is not a good solution. So, first of all, you have to decide what your needs are.

HTH.



 
 
plaszlo





PostPosted: Visual C# General, Database best solution. Top

I would like to create a software that can be used on other computer, without Sql Server, to store the data in a file, and not to add a server connection, all data to be saved in a file, I worked with MS Access file, but I don't know if this way is the best solution.

 
 
David L





PostPosted: Visual C# General, Database best solution. Top

Just in case you didn't know. You can include and deploy a SQL Server database in your project. Are you using VS 2005 In that case, you can try the following:

in the menu, click Data -> Add new data source

Choose Database, New Connection, and set the Data source to Microsoft SQL Server Database file. Fill out the rest of the values.

That would leave you with a SQL Server Database file included in your project. In other words, no need for separate physical servers etc. In a lot of ways it would behave similarly to an Access database, but you'd have all the benifits from SQL Server.


 
 
Mark Benningfield





PostPosted: Visual C# General, Database best solution. Top

Hello All.

plaszlo:

Well, here are a few considerations you might think about:

  • How much data are you thinking about storing
  • What do you need to be able to do with it after it is stored
  • How many users will need to access the data, and will they need to access it at the same time
  • At what point will you need to store it
  • At what point will you need to change it
  • How often will you need to retrieve it
  • How fast do you need to be able to do these things
  • Does the way you're doing it now work
  • Does it work well enough

HTH.



 
 
plaszlo





PostPosted: Visual C# General, Database best solution. Top

 

For example I would like to create a program to store names, phonenumbers, emails, simple, not mutch data. Add new row, edit row and delete rows, simple functions.

 The thing is that the program will be installed on other computer and I would like to work without any other things, just the program. If Im using SQL Server File, the other computer where I'm m installing my program require SQL Server Express too

 

 

Thanks

 



 
 
boban.s





PostPosted: Visual C# General, Database best solution. Top

If your app will not store to much data, you can use xml file as data store. Create xsd schema with all columns that you need in the table or tables, and use generated typed dataset to read and write xml data file .

 
 
Mark Benningfield





PostPosted: Visual C# General, Database best solution. Top

Hello All.

plaszlo:

Yes, if you use a SQL database, then the SQL database engine has to be on the machine. The same is true of any formalized database protocol. If I recall correctly, the database engine for MS Access is the MS Jet database engine, which would have to be present if you used an MS Access database.

If you don't want any additional footprint on the machine except for your executable, you might want to consider creating your own database with XML. .NET has a lot of built-in support for reading, writing, and manipulating data in XML format. But, if you go that route, then you have to implement the logic for inserting, updating, and deleting information yourself. In effect, you would have to be your own database engine.

Now, if you want your file to behave like a true, formally-defined database, then you would also have to make sure that all transactions were ACID, or Atomic, Consistent, Isolated, and Durable. I get the impression, though, that really all you want is an organized data file, not a full-blown Database. In that case, I would say have a look at XML.

HTH.