7 Replies - 365 Views - Last Post: 06 September 2011 - 06:03 PM Rate Topic: -----

#1 teahou  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 223
  • Joined: 01-April 11

Store data in variables or a database?

Posted 06 September 2011 - 03:10 PM

I am pretty sure I need to use a database, but I wanted to verify. I am designing a small app so I can track my hours on the various freelance projects I do. I have come up with some tables to store company names, project names, and start/end times. I figure, because I will be storing information for at least 2 weeks, and sometimes over a couple months, I should store it in a database and just use C# for the form functionality, etc.

Yes, I am fairly new to programming in general, so this may be a no brainer but I had to make sure. thanks.

Is This A Good Question/Topic? 0
  • +

Replies To: Store data in variables or a database?

#2 darek9576  Icon User is offline

  • D.I.C Lover

Reputation: 198
  • View blog
  • Posts: 1,682
  • Joined: 13-March 10

Re: Store data in variables or a database?

Posted 06 September 2011 - 03:13 PM

Persistent storage vs in memory storage. Hope you aint doing any freelance work for me.
Was This Post Helpful? -1
  • +
  • -

#3 teahou  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 223
  • Joined: 01-April 11

Re: Store data in variables or a database?

Posted 06 September 2011 - 04:33 PM

No need to be an ass. I only do design freelance work, not programming because I'm obviously not ready. Thank you for the answer.
Was This Post Helpful? 0
  • +
  • -

#4 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,957
  • Joined: 21-March 08

Re: Store data in variables or a database?

Posted 06 September 2011 - 04:35 PM

You would want to choose some type of persistent storage, which variables are not. So database, flat file, XML file, anything that can be written to and viewed later.

Personally, I would use a database. That's actually what I did for the time entry app that I did for my work.
Was This Post Helpful? 1
  • +
  • -

#5 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5436
  • View blog
  • Posts: 11,656
  • Joined: 02-June 10

Re: Store data in variables or a database?

Posted 06 September 2011 - 05:02 PM

While I am impressed that you want to build your own application for doing this tracking... There is something to be said for not re-inventing the wheel.

ToDoList by AbstractSpoon is a wonderful, feature-rich and free tool built specifically for this. As the name implies it is built around the idea of making a todolist, but is hierarchical and you can start a timer for each element when you start working on it. You can attach files and link files to elements and so on. I've been using it for years and love it.

http://www.abstracts..._resources.html

And did I mention its FREE ?!
Was This Post Helpful? 1
  • +
  • -

#6 Curtis Rutland  Icon User is online

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


Reputation: 4432
  • View blog
  • Posts: 7,702
  • Joined: 08-June 10

Re: Store data in variables or a database?

Posted 06 September 2011 - 05:04 PM

Variables are most certainly not persistent storage. They're around while the program is, and then they're gone, and they're not there when it starts again.

Databases can be a simple answer to persistence. Of course, so can an XML file. Depends on your needs. If you already have a DB server set up, it's a great way of doing it. If you don't, and don't want to set one up, look into Sql Server Compact. It's a "portable" database, in that it needs no server install. It's just a DLL that is added to your program. You can add one through the VS "Add" dialog.
Was This Post Helpful? 1
  • +
  • -

#7 teahou  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 223
  • Joined: 01-April 11

Re: Store data in variables or a database?

Posted 06 September 2011 - 05:53 PM

tlhIn`toq - Thanks for the link. Sounds good, but I am doing this mainly to practice my C#.

Curtis - I have SQL Server 2008 R2 on my computer which seems overkill. I also have a SQL Server 2008 Express disc. Do you think I should uninstall R2 and instal one of the little guys? I will never need the power of a SQL Server full instal on my home computer.
Was This Post Helpful? 0
  • +
  • -

#8 Curtis Rutland  Icon User is online

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


Reputation: 4432
  • View blog
  • Posts: 7,702
  • Joined: 08-June 10

Re: Store data in variables or a database?

Posted 06 September 2011 - 06:03 PM

If you already have it, no need to get rid of it. Use that. Express isn't much smaller, it just contains less features, and is free. Also, if you wanted, there's R2 express out now.

But if you want to use an embedded database, you can give Compact a shot. It doesn't require an install at all.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1