Sign in to follow this  
Levistus

Which tools I need for my program

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 this post


Link to post
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 this post


Link to post
Share on other sites
[quote name='XaserIII' timestamp='1310501681' post='4834478']
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
[/quote]

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

Share this post


Link to post
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 this post


Link to post
Share on other sites
[quote name='Levistus' timestamp='1310501900' post='4834483']
I just want to make it real simple. It's just for a friend.
[/quote]

Then try [url="http://www.sqlite.org/"]Sqlite[/url].

Share this post


Link to post
Share on other sites
[quote name='SuperVGA' timestamp='1310502349' post='4834488']
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.
[/quote]

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 this post


Link to post
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:

[code]SQL QUERY: SELECT * FROM 'PATIENTS' WHERE NAME = 'George Walmer';[/code]

which will then return you data

Have a short look at the [url="http://www.sqlite.org/docs.html"]SQLITE Documentation[/url] 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 this post


Link to post
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 this post


Link to post
Share on other sites
[quote name='ApochPiQ' timestamp='1310506287' post='4834522']
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.
[/quote]

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 this post


Link to post
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 this post


Link to post
Share on other sites
[quote name='Levistus' timestamp='1310546595' post='4834694']
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.
[/quote]
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 this post


Link to post
Share on other sites
[quote name='SuperVGA' timestamp='1310547441' post='4834705']
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.
[/quote]


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 this post


Link to post
Share on other sites
Sure, its basic file I/O programming. What language are you intending to use, -Visual Studio have a few:
[url="http://lmgtfy.com/?q=C%2B%2B+read+csv"]This link[/url] point to many articles and/or threads concerning reading files with C++.
My suggested pseudocode is
[code]
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
[/code]

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

Share this post


Link to post
Share on other sites
[quote name='_moagstar_' timestamp='1310559101' post='4834794']
When you say Visual Studio, which language in particular are you going to be using to implement this?
[/quote]

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.
[img]http://i51.tinypic.com/2zgyvkk.png[/img]

Share this post


Link to post
Share on other sites
[quote name='Levistus' timestamp='1310561674' post='4834806']
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.
[/quote]


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 [url="http://www.functionx.com/vbnet/fileprocessing/serialization.htm"]this[/url] will give you some ideas about how you can implement serialisation / deserialisation.

Share this post


Link to post
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 [url="http://www.functionx.com/vbnet/fileprocessing/serialization.htm"]http://www.functionx.com/vbnet/fileprocessing/serialization.htm[/url]
or this one [url="http://www.c-sharpcorner.com/UploadFile/afenster/185/"]http://www.c-sharpcorner.com/UploadFile/afenster/185/[/url].

Share this post


Link to post
Share on other sites
[quote name='Levistus' timestamp='1310640279' post='4835205']
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 [url="http://www.functionx.com/vbnet/fileprocessing/serialization.htm"]http://www.functionx...rialization.htm[/url]
or this one [url="http://www.c-sharpcorner.com/UploadFile/afenster/185/"]http://www.c-sharpco...e/afenster/185/[/url].
[/quote]


[url="http://en.wikipedia.org/wiki/Serialization"]Serialization[/url] is the process of converting your in-memory objects into a form which can be transferred, and then later [i]deserialised[/i] 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:

Name="Bill Bailey" Address="1 Funny Road, England" [more fields go here]
Name="Paddington Bear" Address=[font="Arial"]"[size=2]32 Windsor Gardens" [more fields go here][/size][/font]
[font="Arial"][size=2][more records go here][/size][/font]
[font="Arial"][size=2]
[/size][/font]
[font="Arial"][size=2]Then your deserialise function takes each of those patient records and rebuilds the dictionary that you had before.[/size][/font]
[font="Arial"][size=2]
[/size][/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.[/size][/font]
[font="Arial"][size=2]
[/size][/font]
[font="Arial"][size="2"]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.[/size][/font]
[font="Arial"][size="2"]Good luck![/size][/font]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this