Click here to Skip to main content
13,044,584 members (63,604 online)
Rate this:
Please Sign up or sign in to vote.

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 12-Nov-11 0:39am
Updated 12-Nov-11 14:57pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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[^]
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 12 Nov 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100