Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

932 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

11 Experts available now in Live!

Get 1:1 Help Now