Click here to Skip to main content
15,311,385 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
where should I place the connection string, database username and the password for an access database in an XML file?
Posted
Comments
Kim Togo 28-Jul-11 2:32am
   
Any where you like. XML files are just text files.

XML is not a database - it is a flat, human readable (text based) file format. It can be treated as a primitive database, in that data can be organised within it, but it is not a good way to handle information that will be changed frequently, accessed by multiple users, or which requires searching or indexing. If you need these features, then you need to look at a "proper" database system instead.

It also does not have a concept of "users" or "passwords".

The connection string consists solely of the path to the file, so you can put it where you like! I would recommend you store it in your application config file so that you can move the file should you need to.
   
Why don't you use App.Config file?
   
Then how can I able to use App.Config file within vb 2005 and vb 2008? I want to use the XML file not as a database but I really need it to store the username and password of the database externally. So that I will able to reset the database password easily without compiling the whole program again!
   
v2
Comments
Mehul M Thakkar 1-Aug-11 0:46am
   
Don't write your question in solution part. If you have any question to solution then add in solution's comment section using "Add comment"
Mehul M Thakkar 1-Aug-11 0:49am
   
Many Articles are there to store connection string in App.config file, and without compile you can modify it. See the following links,

http://www.dotnetspider.com/forum/33660-How-write-connection-string-app-config-file.aspx

http://www.telerik.com/community/code-library/reporting/general/use-the-connectionstring-from-your-app-s-config-file.aspx

http://social.msdn.microsoft.com/Forums/en-GB/adodotnetdataproviders/thread/9a8c9f5a-092e-4c4a-87bb-9f35d8f55da1

http://www.ezzylearning.com/tutorial.aspx?tid=8067328
Chiranthaka Sampath 1-Aug-11 3:37am
   
OK I accept your answer but you are giving me the answers for C# not to VB 2005! Please give me the VB 2005 code! Thanx
I want the VB 2005 solution not the C# solution.
   

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