473,383 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Adding values to a combobox from a set of ENUM constants from web

I'm learning Visual Basic using the .Net Framework 2.0. I have been playing
with consuming web services in applications.

I am using a free web service that gives me information for currency
conversion. The web service I am using is:

http://www.webservicex.net/CurrencyConvertor.asmx?WSDL

It's got pretty much everything I need, but I'm running into trouble.

I want 2 comboboxes in the application. Both of them need to contain the
names of the currencies that provide conversion factors. The names of the
currencies are 3 letter names that are names of are ENUM constants.

The function that provides the copnversion factor takes 2 arguments -- The
currency we're converting FROM, and the currency we're converting TO.

I'm trying to get the constant names in the dropdowns.

Here's the code so far:

Imports CurrencyConversion.wsCurrency.CurrencyConvertor
Imports CurrencyConversion.wsCurrency.Currency
Imports System.Windows.Forms

Public Class frmMain

Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim wsCurrencyNames As CurrencyConversion.wsCurrency.Currency

Dim arrayCurrencyName As New ArrayList()
'For Each wsCurrencyNames In
CurrencyConversion.wsCurrency.Currency.GetNames(Ge tType(wsCurrency.Currency))
'cbxFromCurrency.Items.Add(wsCurrencyNames.ToStrin g())
'cbxToCurrency.Items.Add(wsCurrencyNames.ToString( ))
'Next

'cbxFromCurrency.DataSource =
System.Enum.GetNames(typeof(CurrencyConversion.wsC urrency.Currency))
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim dblRate As Double
Dim wsConvert As New wsCurrency.CurrencyConvertor
dblRate = wsConvert.ConversionRate(GBP, USD)
rtbResults.Text = CStr(dblRate)
End Sub
End Class
This line:
dblRate = wsConvert.ConversionRate(GBP, USD)

is the function that does work when values are entered directly. But I want
the user to choose from the list. Any ideas?
--
Richard Tocci
College Station, TX

Jun 19 '07 #1
2 2097

"Richard Tocci" <richardftoccijr at hotmail dot comwrote in message
news:BE**********************************@microsof t.com...
I'm learning Visual Basic using the .Net Framework 2.0. I have been
playing
with consuming web services in applications.

I am using a free web service that gives me information for currency
conversion. The web service I am using is:

http://www.webservicex.net/CurrencyConvertor.asmx?WSDL

It's got pretty much everything I need, but I'm running into trouble.

I want 2 comboboxes in the application. Both of them need to contain the
names of the currencies that provide conversion factors. The names of the
currencies are 3 letter names that are names of are ENUM constants.

The function that provides the copnversion factor takes 2 arguments -- The
currency we're converting FROM, and the currency we're converting TO.

I'm trying to get the constant names in the dropdowns.

Here's the code so far:

Imports CurrencyConversion.wsCurrency.CurrencyConvertor
Imports CurrencyConversion.wsCurrency.Currency
Imports System.Windows.Forms

Public Class frmMain

Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim wsCurrencyNames As CurrencyConversion.wsCurrency.Currency

Dim arrayCurrencyName As New ArrayList()
'For Each wsCurrencyNames In
CurrencyConversion.wsCurrency.Currency.GetNames(Ge tType(wsCurrency.Currency))
'cbxFromCurrency.Items.Add(wsCurrencyNames.ToStrin g())
'cbxToCurrency.Items.Add(wsCurrencyNames.ToString( ))
'Next

'cbxFromCurrency.DataSource =
System.Enum.GetNames(typeof(CurrencyConversion.wsC urrency.Currency))
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim dblRate As Double
Dim wsConvert As New wsCurrency.CurrencyConvertor
dblRate = wsConvert.ConversionRate(GBP, USD)
rtbResults.Text = CStr(dblRate)
End Sub
End Class
This line:
dblRate = wsConvert.ConversionRate(GBP, USD)

is the function that does work when values are entered directly. But I
want
the user to choose from the list. Any ideas?
I don't know if you need the Spilt String function or not, because it's
unclear as to what you need to do.

http://builder.com.com/5100-6371-6030362.html

Jun 19 '07 #2
Not quite. Upon further research of this web service, it looks like there is
ANOTHER web service that actually provides me the information I need. Why
it's not all part of the SAME web service, I don't know.

I'll post more if I run into trouble.
--
Richard Tocci
College Station, TX
"Mr. Arnold" wrote:
>
"Richard Tocci" <richardftoccijr at hotmail dot comwrote in message
news:BE**********************************@microsof t.com...
I'm learning Visual Basic using the .Net Framework 2.0. I have been
playing
with consuming web services in applications.

I am using a free web service that gives me information for currency
conversion. The web service I am using is:

http://www.webservicex.net/CurrencyConvertor.asmx?WSDL

It's got pretty much everything I need, but I'm running into trouble.

I want 2 comboboxes in the application. Both of them need to contain the
names of the currencies that provide conversion factors. The names of the
currencies are 3 letter names that are names of are ENUM constants.

The function that provides the copnversion factor takes 2 arguments -- The
currency we're converting FROM, and the currency we're converting TO.

I'm trying to get the constant names in the dropdowns.

Here's the code so far:

Imports CurrencyConversion.wsCurrency.CurrencyConvertor
Imports CurrencyConversion.wsCurrency.Currency
Imports System.Windows.Forms

Public Class frmMain

Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim wsCurrencyNames As CurrencyConversion.wsCurrency.Currency

Dim arrayCurrencyName As New ArrayList()
'For Each wsCurrencyNames In
CurrencyConversion.wsCurrency.Currency.GetNames(Ge tType(wsCurrency.Currency))
'cbxFromCurrency.Items.Add(wsCurrencyNames.ToStrin g())
'cbxToCurrency.Items.Add(wsCurrencyNames.ToString( ))
'Next

'cbxFromCurrency.DataSource =
System.Enum.GetNames(typeof(CurrencyConversion.wsC urrency.Currency))
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim dblRate As Double
Dim wsConvert As New wsCurrency.CurrencyConvertor
dblRate = wsConvert.ConversionRate(GBP, USD)
rtbResults.Text = CStr(dblRate)
End Sub
End Class
This line:
dblRate = wsConvert.ConversionRate(GBP, USD)

is the function that does work when values are entered directly. But I
want
the user to choose from the list. Any ideas?

I don't know if you need the Spilt String function or not, because it's
unclear as to what you need to do.

http://builder.com.com/5100-6371-6030362.html

Jun 19 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Nebula | last post by:
Consider enum Side {Back,Front,Top,Bottom}; enum Side a; Now, why is a = 124; legal (well it really is an integer, but still, checking could be performed..) ? Wouldn't enums be more useful if...
3
by: Alan | last post by:
Hi, is it possible to create a project that can offer different members of a Public Enum according to a condition ? I mean, Project A has a public enum. Project B & C access A's enum. However B...
4
by: UJ | last post by:
I know how to define enums, and they work great. But is there any way to define the same time of thing but give them actual values? For instance, I'd like to define something with the idea...
47
by: Pierre Barbier de Reuille | last post by:
Please, note that I am entirely open for every points on this proposal (which I do not dare yet to call PEP). Abstract ======== This proposal suggests to add symbols into Python. Symbols...
5
by: Matt D | last post by:
I have a bunch of constants used in my web services that the client also needs to have. Is there a way to declare public properties that are part of a class or structure as constants or at least...
6
by: cipher | last post by:
I have some constant values in my web service that my client application will require. Having to keep server side and client side definitions insync is tedious. I am trying to do something like...
9
by: Fred Zwarts | last post by:
What is the recommended way to loop over all enum values of a certain enum type? Consider the following definition: typdef enum {A=2, B, C=5, D} E; then for (E x = A; x <= D; ++x) { ... }
8
by: Bart Simpson | last post by:
typedef enum { ACCESS_DENIED = 1, ACCESS_READ_ONLY = 2, ACCESS_READ_WRITE = 4 }AccessTypeEnum ; Is this legal? - can I have 'gaps' in the enumeration integer values as above ?
13
by: toton | last post by:
Hi, I have some enum (enumeration ) defined in some namespace, not inside class. How to use the enum constant's in some other namespace without using the whole namespace. To say in little...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.