Jump to content
  • Advertisement
Sign in to follow this  
RealLDG

Local database using VB.net

This topic is 4115 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have done small programs using Access, MySQL, and SQL...nothing major, just basically learning. Oddly enough, my problem is this; I want to create a program which stores certain information and recalls it from what they previously entered...but I have no idea how to do this without using a method above. Not everyone would have Access, etc., so I am wondering how the best way to do this would be. Not a huge database, possibly 1500 entries if even that.

Share this post


Link to post
Share on other sites
Advertisement
Anyone know the best way? Anyone know a guide or place I could find these answers?

Using a largescale DB won't work out...I was thinking like...a specific file (.???, specifically for my program, but have no clue how to make that yet).

Share this post


Link to post
Share on other sites
Try Googling for "System.IO namespace" or "vb.net file creation".

Not like I know exactly what you're trying to do but...

If you and a bunch of buddies are going to be accessing this file and you want it to be updated for everybody, you probably should look at using a database. If you have some webspace and they give you some database functionality you can keep your database there and everyone with an internet connection should be able to take advantage of it. You could then have an intreface to the database through a web page (w3schools.com is a good resource for how to do this) or a VB.net program and everybody's data is upto date.

Share this post


Link to post
Share on other sites
It would be individual databases...where I would create a UI for them to enter...say a name, details, etc., and be able to pull it up later. It would be unique for all users, since it would start 'blank'.

Share this post


Link to post
Share on other sites
If you wanted to use Access as the data store, it is not necessary for the end users of your app to have Access installed. You just have to instruct your app on how to use the database, and you're set. The database libraries don't care whether a particular database software (in this case, Access) is installed on the same computer.

Share this post


Link to post
Share on other sites
Depending on how complex your data is (or rather how simple it is) you could make use of a simple flat file database (random access file with fixed records).

You may not need an over complicated DB if the requirements are simple enough.

Even if the data is variable length, if you know the data size limits you could still use a fixed size block reading/writing to an file treating it as a linear array. An index could be setup in the files header and also kept in memory for quick lookup (kept sorted if needed). You could even cache the whole DB in memory if the size isnt a problem (1500 records of what kind of data???...).

Such as system isnt that hard to program and would likely be faster and certainly smaller than connecting to a seperate DB subsystem.

Share this post


Link to post
Share on other sites
Our requirements were the same as yours. Remember not to make it overly complex. We have made it simpler as we went, as we realized we didn't really need any of the fancy features.

Basically, when making changes in the file, you could have fixed length variable sizes so you can change them without having to move the rest of the data in the file. However, if speed is not important to you, you could just rewrite the whole file each time.

We went with the latter approach, since tests with up to 8192 rows (~26 megabyte file) still didn't take more than 400 ms to complete.

The structure is simple. We write a header which contains row sizes, and amount of fields. Then each value is written out from "left to right" trough each row. This is enough for us being that we will always read the entire file into memory (editor) or parse it row by row (ingame).

Good luck.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!