Solved

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

Posted on 2008-06-17
3
240 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now