Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what is the best way to do?

Status
Not open for further replies.

lydro

Programmer
Mar 7, 2005
36
CA
In my vb app, I have a sql connect string in my publicModule. when the user install the app, it will ask the "Initial Catalog" and "Data Source" value, then open the app. if the user input the wrong value, then the app can't open the sql data, how can I check the two value are matching in the sql data? and what's the best way to put the sql connection string in my app.

I created a registry key for the two value. Is it the best way? how can I check the registry key if it's not exist?

Lisa
 
try catch while you open the connection is a must in your case.



Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
I would also recommend using a XML or INI file to store your settings in. I've never been a fan of the registry.

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
how can I use the INI file? I never deal with the INI file before, would you please give me some samples? Thanks
 
INI files are just flat text files that contain tags and values. The more common standard these days is to use XML files. With ADO.Net, using XML files is easy because you can use the Dataset object to .WriteXML and .ReadXML.

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
There is an open-source project on sourceforge.net called nini (.net INI file), which is very nice.


Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top