# Which tools I need for my program

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

## Recommended Posts

I'm going to make a patients database program for an eye clinic. I'm going to use Visual Studio to make the interface. What database should I use if I don't need a connection? Just a local one where I should be able to see the database file so I can copy it for backup. Thanks.

##### Share on other sites
Hm for databases in general which store bigger amounts of Data, SQL or MySQL is always a good answer. I wouldn't store the data in a single file for safety reason etc. MySQL will enable you to copy and backup the data quickly and organize your data efficiently.

Greetz
Xaser

##### Share on other sites

Hm for databases in general which store bigger amounts of Data, SQL or MySQL is always a good answer. I wouldn't store the data in a single file for safety reason etc. MySQL will enable you to copy and backup the data quickly and organize your data efficiently.

Greetz
Xaser

I just want to make it real simple. It's just for a friend.

##### Share on other sites
Try SQLite, it's really minimalistic and a good abstraction from larger, conventional databases. It also relieves you of running a separate database server on your local machine, as the database is already integrated in SQLite.

##### Share on other sites

I just want to make it real simple. It's just for a friend.

Then try Sqlite.

##### Share on other sites

Try SQLite, it's really minimalistic and a good abstraction from larger, conventional databases. It also relieves you of running a separate database server on your local machine, as the database is already integrated in SQLite.

Ok so how does this work? I make the program with Visual Studio then use SQLite for the database? Like making the table in command prompt? Or can I make the table in Visual Studio? I dunno how SQL works. I mean connecting to the server and stuff. How about MS Access?

##### Share on other sites
Well SQL has its own "Language" so to speak. I Don't know SQLite very well, but it seems appropriate for your problem. If it works the same way as MySQL you can get for example data from the table via a library you need to include and then call commands to the database like:

SQL QUERY: SELECT * FROM 'PATIENTS' WHERE NAME = 'George Walmer';

which will then return you data

Have a short look at the SQLITE Documentation to see whether you can use it or not. You will find that SQLite is basically like normal SQL but doesn't need an SQL server and just uses a File as Database.

Xaser

##### Share on other sites
Do you even need a SQL database? A BinaryFormatter and a serializable data structure would be much easier unless you're planning on making large changes to your data structures all the time.

Are there going to be millions of patients? Will there be multiple people accessing the data at the same time?

##### Share on other sites
Don't use a database, even Sqlite.

Seriously, it's massive overkill. Just store a list of records in structures in memory, and serialize them to disk as needed.

##### Share on other sites

Don't use a database, even Sqlite.

Seriously, it's massive overkill. Just store a list of records in structures in memory, and serialize them to disk as needed.

In this situation you are probably right. His Problem doesn't seem to have any chances to be used as a real product. However if it was an SQL database would be better as it could be extended more easily to Server Application, easier access, faster access etc. etc. So it depends on the extend of the program.

Xaser

##### Share on other sites
Actually I already made a program like this before for my friend. my mistake was I didn't need a Server-based database which I just copied from an youtube tutorial. I just asked her how many records are there now in the database, and she said 1k+. Omg what am I gonna do if something happens to the program and all those records got lost. I was just trying to help her with their small business.

Here's what I remembered doing. Maybe you guys can identify how I can fix this or you can give ideas on how to avoid the same mistake.
1. I used Visual Studio
2. I made a VB Windows Forms Application
3. I made a Service-Based Database called Database1.mdf which is a Dataset Model
4. I chose save connection string to Database1ConnectionString
5. Dataset name is Database1Dataset
6. I added a table to the database and put stuff in the Columns and data types.
7. I then added it to the Data Source.
8. I then dragged from the Data Source, each column to the forms so they have a Label: Textbox
9. Then dragged again to get a datagrid view.
10. Edited the forms to have better looking add, new, save, previous, next buttons and added a simple search using filter.
11. Then I published it to my computer. After testing, I archived it then sent to my friend.
12. She installed it and is now using it.

She was glad with how simple it was cause I made it with Visual Studio. Now I dunno how to export the database file from her computer/copy of program to make a backup. I dunno what to do.
I know I didn't ask for anything in return but if the program messes up I'd feel bad. 1k+ records already jesus christ and the program has like 74 columns/textboxes. Someone help please.

BTW the DataBindingSource is the thing that connects the textbox to the database.

EDIT:

OMG she says she's just going to add all the records for this year and tells me it could reach 15k or more records total this July. Holy shit I'm just a newbie programmer what the hell did I get myself into. I just copied stuff from youtube so I can make her a program.

Someone please help me with making a new program. With that amount of records, what database should I use? The important thing is it's easy to use like how I made it with Visual Studio. Or am I panicking too much and 15k records is nothing?

I don't mind re-creating the program.

##### Share on other sites

Actually I already made a program like this before for my friend. my mistake was I didn't need a Server-based database which I just copied from an youtube tutorial. I just asked her how many records are there now in the database, and she said 1k+. Omg what am I gonna do if something happens to the program and all those records got lost. I was just trying to help her with their small business.

Here's what I remembered doing. Maybe you guys can identify how I can fix this or you can give ideas on how to avoid the same mistake.
1. I used Visual Studio
2. I made a VB Windows Forms Application
3. I made a Service-Based Database called Database1.mdf which is a Dataset Model
4. I chose save connection string to Database1ConnectionString
5. Dataset name is Database1Dataset
6. I added a table to the database and put stuff in the Columns and data types.
7. I then added it to the Data Source.
8. I then dragged from the Data Source, each column to the forms so they have a Label: Textbox
9. Then dragged again to get a datagrid view.
10. Edited the forms to have better looking add, new, save, previous, next buttons and added a simple search using filter.
11. Then I published it to my computer. After testing, I archived it then sent to my friend.
12. She installed it and is now using it.

She was glad with how simple it was cause I made it with Visual Studio. Now I dunno how to export the database file from her computer/copy of program to make a backup. I dunno what to do.
I know I didn't ask for anything in return but if the program messes up I'd feel bad. 1k+ records already jesus christ and the program has like 74 columns/textboxes. Someone help please.

BTW the DataBindingSource is the thing that connects the textbox to the database.

Just export the sql as comma separated vectors and create a nice and solid function to read it back into your new program.

With all 40-character ANSI strings (which is probably overkill), 74 columns and 1000 entries, the dataset will not exceed 24 MB, so you're good even on last-millennium machinery. ;-)

If that's all it's much simpler to, like ApochPiQ said, just implement a datastrucure to contain that yourself.
Just remember to back up your files to a remote machine and you should be good. :-)

EDIT: Yes, even with >15k records it will be fine. An existing db would help fetch entries from many different expressions, and sort easily,
but in the end its likely that it will be easier to do it yourself. Those processes may take longer, but storage wise 15k doesn't sound like anything you should be worried about.

##### Share on other sites

Just export the sql as comma separated vectors and create a nice and solid function to read it back into your new program.

With all 40-character ANSI strings (which is probably overkill), 74 columns and 1000 entries, the dataset will not exceed 24 MB, so you're good even on last-millennium machinery. ;-)

If that's all it's much simpler to, like ApochPiQ said, just implement a datastrucure to contain that yourself.
Just remember to back up your files to a remote machine and you should be good. :-)

EDIT: Yes, even with >15k records it will be fine. An existing db would help fetch entries from many different expressions, and sort easily,
but in the end its likely that it will be easier to do it yourself. Those processes may take longer, but storage wise 15k doesn't sound like anything you should be worried about.

How do I export the sql as comma separated vectors? Can you give me a simple pseudocode for the function to read it back to the program?

Also how do I do ApochPiQ's suggestion? Can I do that using Visual Studio?

##### Share on other sites
Sure, its basic file I/O programming. What language are you intending to use, -Visual Studio have a few:
My suggested pseudocode is
 datastructure entry eye color patient name ssc load function read file (file_name) for every line in file split on comma you know what columns come when, so you can just read every field into your datastructure for a single entry 

A comma separated file can be exported through Visual Studio in the section for your database.

##### Share on other sites
When you say Visual Studio, which language in particular are you going to be using to implement this?

##### Share on other sites

When you say Visual Studio, which language in particular are you going to be using to implement this?

I used Visual Basic. If I have to recreate should I switch to Visual C#? I need to use these Visual stuff to make it easier for me and my friend.

btw guys here's how the program looks like. those are the tabs. dunno how to export the database though, or how to make it exportable next time when I recreate it.

##### Share on other sites

I used Visual Basic. If I have to recreate should I switch to Visual C#? I need to use these Visual stuff to make it easier for me and my friend.

I don't think that is necessary if you've already made some substantial progress using VB and you are comfortable working in that environment. I assume you are filling some kind of data structure with the information from each of these fields? Perhaps this will give you some ideas about how you can implement serialisation / deserialisation.

##### Share on other sites
guys as you can see in my program(screenshot) what do you think I should use? it's going to be used on one computer only and accessed by one person. Patient records could reach 20k. I want it to have forms btw so it's easy for the user who is not good with computers. i'm not good with terminologies so I don't know what to use. Database? Serialization? Sqlite? File-based Database? What do you think?

Edit:
I could try _moagstar_'s suggestion http://www.functionx.com/vbnet/fileprocessing/serialization.htm

##### Share on other sites

guys as you can see in my program(screenshot) what do you think I should use? it's going to be used on one computer only and accessed by one person. Patient records could reach 20k. I want it to have forms btw so it's easy for the user who is not good with computers. i'm not good with terminologies so I don't know what to use. Database? Serialization? Sqlite? File-based Database? What do you think?

Edit:
I could try _moagstar_'s suggestion http://www.functionx...rialization.htm
or this one http://www.c-sharpco...e/afenster/185/.

Serialization is the process of converting your in-memory objects into a form which can be transferred, and then later deserialised so that you get the same objects back again. The exact transfer process could be for example transferring the data to your filesystem or transferring the data across a network. For your purposes you are interesting in storing the objects you have in memory into a file for backup. You could use sqlite for this, but as others have pointed out it's overkill, and I wouldn't complicate this more than you need to.

Like I said, I assume that you are filling some kind of data structure (a dictionary?) with a record for each patient that holds information from those forms, what you need to do is write two functions...serialise and deserialise for this data structure. The serialise function is responsible for taking each of those patient records and writing them to a file in some form, for example your patient database file could look like this:

[font="Arial"][size=2][more records go here][/font]
[font="Arial"][size=2]
[/font]
[font="Arial"][size=2]Then your deserialise function takes each of those patient records and rebuilds the dictionary that you had before.[/font]
[font="Arial"][size=2]
[/font]
[font="Arial"][size=2]The example I show here is using a crude text based serialisation scheme, but how you store the data is up to you, comma seperated, xml or even binary if you want to reduce the size of your file.[/font]
[font="Arial"][size=2]
[/font]
[font="Arial"]If you couldn't already tell, my suggestion is to leave sqlite to one side until you need to do something more complicated and figure out how to serialise/deserialise the data you already have.[/font]
[font="Arial"]Good luck![/font]