Solved

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

Posted on 2008-06-17
3
270 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

730 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