Click here to Skip to main content
15,899,825 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
Day to day appointments would be stored n a file so it would be better if it is a windows app and now if i click on the search button and give a date in the textbox then the appointments on that day should be displayed in files concept. and not used any external database like sqlserver,oracle etc......
Posted
Updated 20-Mar-12 22:31pm
v10
Comments
CPallini 20-Mar-12 5:33am    
Uh?
sravani.v 20-Mar-12 5:38am    
Elaborate your question
OriginalGriff 20-Mar-12 5:39am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff 20-Mar-12 6:12am    
That still doesn't help: we need to know what you are trying to search - database? text file? the internet? - and how you want to search it. Are you using Winforms? WPF? A Service? WCF? Web app? Web site?
All of these affect the answer!
Seriously, we can't read your mind!
OriginalGriff 20-Mar-12 6:23am    
Ok, so it's a console app. That helps, a bit.
Now, where is the data? What does the data contain? How is the date you want to search for stored?
(This is like pulling teeth!)

1 solution

What you are trying to do is quite complex - at least to do correctly.
The problem is that "appointments" change: the date changes, the time changes, they get cancelled, they get added, so if you are storing them in a text based file then you have a lot of problems: the file has to be re-written completely after each change. In addition, you add other complications:
1) All data needs to be converted from text to internal values such as dates, strings, etc before you can use them.
2) You will have to handle sorting and searching yourself.
3) Records will not be fixed length (or are unlikely to be at any rate).
4) You will have to handle separator characters yourself - and cope with them when they appear in a value to be saved.
For example, if you decide that values are separated by commas, what do you do when an entry in your appointments list is for "Buy oil, groundnut" as appears in my to-do list from time to time?
5) You will have to handle data recovery if the file becomes corrupted - for example if someone edits it by hand.

Unless this is homework, and clearly specified as "use a text file" then I would not do that - I would use a database of some form - SQLCE is pretty simple and can be installed with your app as part of the deployment.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900