Solved

How do you use the GetValue method in Visual Basic .NET???

Posted on 2008-06-17
3
261 Views
Last Modified: 2013-11-07
I get a compiler error from the code below, "Expected ','". At least it looks like a comma. I've used the function from C Sharp by using a similar statement, but I have a project in VB.

Please help!!!

Rant: this kind of thing makes me hate Microsoft. This functionality could be so much easier!!!
Imports System.Configuration 'for settings
 
Dim Settings As AppSettingsReader = New AppSettingsReader()
 
Dim Addresses As String = Settings.GetValue("AlliedQuoteRequestEmailAddress", typeof(System.String))

Open in new window

0
Comment
Question by:CRESLISA
  • 2
3 Comments
 
LVL 24

Accepted Solution

by:
Jeff Certain earned 250 total points
ID: 21805914
TypeOf does something completely different in VB :)
		Dim Settings As New System.Configuration.AppSettingsReader
		Dim Addresses As String = Settings.GetValue("AlliedQuoteRequestEmailAddress", GetType(System.String))

Open in new window

0
 
LVL 1

Author Closing Comment

by:CRESLISA
ID: 31468078
actually, your code still needs to be cast to a string, but that was no problem
0
 
LVL 24

Expert Comment

by:Jeff Certain
ID: 21806019
Ah... depends if you have option explicit on or not :)
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to read text with RegEx... 2 25
Get month and date in a format 4 31
Code works but breaks when I add one section 4 20
How to repeat the data 4 17
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question