|
-
Feb 10th, 2015, 02:47 PM
#1
Thread Starter
New Member
[RESOLVED] Extremely quick question: My.settings | How do I use data stored on a variable.
Hello all,
I have been experimenting with my.settings I love the idea mechanic but am unsure how to implement it.
My attempts are trying to get a database path in my.settings.DBpath that I have stored and able to change but I want to be able to get it to load into a variable so that I can actually use it fully.
This is extremely simple of a request but I been looking through the various sub parameters for something like text or data or content and cannot find anything that functions like how a textbox would. When I try i get this error : ArgumentException was unhandled
Format of the intialization string does not conform to specification starting at index 35.
-
Feb 10th, 2015, 02:56 PM
#2
Hyperactive Member
Re: Extremely quick question: My.settings | How do I use data stored on a variable.
That error message doesn't really mean much to us because you didn't post any code, esp. around the line where this error occurs.
Using Settings is pretty easy, and doesn't take much to get at their values. Assuming you have the DBPath as a String Setting:
Code:
Dim strDBPath As String = My.Settings.DBPath
If IO.File.Exists(DBPath) Then
' Open connection to DB
Else
' Alert user that it cannot find DB
End If
-
Feb 10th, 2015, 03:03 PM
#3
Thread Starter
New Member
Re: Extremely quick question: My.settings | How do I use data stored on a variable.
Thank you pyth007, I was more asking for a quite tutorial as to how to use it then actual code being provided as I find asking for a concept of how to use the mechanic is more useful in this case. Thank you very much, another question I have about this method is since it allows for permanent saving of values does it survive from user to user on a windows system or does it keep separate instances for each user? just curious as sometimes it will load changed value other times not but maybe down to my cleaning programs I have installed.
-
Feb 10th, 2015, 03:10 PM
#4
Re: Extremely quick question: My.settings | How do I use data stored on a variable.
It depends. If it is user-scoped then each user gets their own value stored in their own user config file in their machine. If it is application-scoped, then it's read-only anyways and hte user isn't going to be able to change it (unless you use a means to directly open config file and manage it yourself... I suspect though that this isn't a case like that.)
-tg
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|