I need one help from you guys......
I have one application and in that I need to take the decision based on the status of the database ........
if database is available then I need to activate menu..................
now at runtime i m getting one event and i m storing status in one variable whether it's available or not.......
but somehow if application gets closed then again I need to know whether database is available or not
so which is the best approach............
1) whether to store status in one file (which type of file xml, ini (in terms of performance))
2) again check in that folder whether it's available or not
I want to take the best decision...........Please help me in this :-)

Need suggestion.....................
PublicError
KjeZ
sudheer_316
If security of the file - accidental deletion or tampering with the contents could be an issue, you might want to consider storing the information in registry also... if you are reading/writing the information from a windows application.
But again, as ahmedilya said the type of file depends on your data. I won't consider .ini files, when it comes to storing information something like configuration and rather use XML. If the information you are storing is plain textual information and does not consist any categorical structure, I would use text files.
Crane101
well in order to check if the database exists, when you connect to SQL Server you will have generally 3 errors possible:
1) timeout - couldnt find server or something
2) database does not exist
3) access denied
the first 2 errors are more likely really and will indicate if you should enable/disable your menu system. You could store the status to a file but what would the point be, since the status of the database could change at any time
If you are talking about checking the status for your current session when running the application, you could hold it in a variable to indicate the status but even then, during the lifetime of that session of the application, the status of the database may change.
Magius
without a doubt xml :-)
however again it depends what you want to store - the bits of information. I mean what will you read/write in terms of the server status
Gordon Bell
Thanks for the answer
But here I just want to save some data at runtime......................and want to read it when my application starts.....
which file is the best file................ xml or txt or ini...........