Click here to Skip to main content
15,881,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Updated

This is my question.

I will set a password to my database created using MS Access 2007. I will place at my 'Connection-string' statement which in ADO.NET 2.0 using VB 2005. But if I change the password I will have to recreate my setup file and install the new version to the computer.

I heard that, that kind of information (the DBMS password) can be stored in an XML file and then that XML file can be read to get the password. If the DBMS password reset, only have to edit that particular XML file only. Then no need to recompile or create a new setup file.

In ASP.Net 2.0 has a option called as appConfig. But I will develop windows application not web application.

So I want to know how to and where should store my DBMS password in the XML.
Also I want to know how to read that particular XML file and the password and where should i place that XML file when the
system is being developed.



If any you guys want to help me don't think this is a naive idea!

Thanks a lot!
Posted
Updated 12-Nov-11 14:57pm
v2

1 solution

You can store the password any way you want. If you know how to read and write data to a file, you're all set. XML is one option but I'm sure you can think of others.

The "Microsoft" way of doing this is using the application's settings file.

Application Settings Overview[^]

How to: Create Application Settings Using the Designer[^]

Then just read the password and add it to your connection string, or use a ConnectionStringBuilder[^]
 
Share this answer
 
Comments
Chiranthaka Sampath 12-Nov-11 20:38pm    
In here you have mentioned about VB 2010. But my requirement is vb 2005. The articles you have produced are much complex than I think. Please solve my problem!

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