Click here to Skip to main content
15,915,093 members
Please Sign up or sign in to vote.
2.33/5 (3 votes)
See more:

I have 1 column currency in database, now i wanto display that currency in a label at runtime.is it possible?

e.g i have 1 combo box where different currencies are there and also another amt column.
now i want to display currency value in a lable rather than a textbox beacuse in textbox the amt will show and beside that if i take lable,then the currency will show which is fetched from database.

so can i display a value in lable fetched from database? and it should be dynamic at run time,like will change values as and when selected different currencies.

can anyone tell me.
thanks in advance
Posted
Updated 16-Aug-13 21:43pm
v3
Comments
Sergey Alexandrovich Kryukov 17-Aug-13 0:41am    
You need to tag the UI library or application type you are using. Of course, it's possible. And there is absolutely no difference what you update, a text box or a label. http://whathaveyoutried.com? Any particular problems?

One note: please keep in mind: there are no controls which are not "dynamic at run time". They are all equally "dynamic", even if you use the designer.

—SA
sudeshna from bangkok 17-Aug-13 0:48am    
how to tag ui library or application? can you plz tell me? i dont know
sudeshna from bangkok 17-Aug-13 0:49am    
Dim sumAmount As Double = 0
Dim premiumValue As Double
Dim vatvalue As Double
For Each row As DataRow In ds.Tables("item1").Rows
TextBox1.Text = DirectCast(row, System.Data.DataRow)("name").ToString()
TextBox8.Text = DirectCast(row, System.Data.DataRow)("bname").ToString()
TextBox2.Text = DirectCast(row, System.Data.DataRow)("place").ToString()
TextBox3.Text = DirectCast(row, System.Data.DataRow)("date").ToString()
TextBox4.Text = DirectCast(row, System.Data.DataRow)("year").ToString()
ListBox1.Items.Add(DirectCast(row, System.Data.DataRow)("lot_no").ToString())
ListBox2.Items.Add(DirectCast(row, System.Data.DataRow)("amt").ToString())



sumAmount = sumAmount + Convert.ToDouble(DirectCast(row, System.Data.DataRow)("amt"))

Next
premiumValue = (0.175 * sumAmount)
vatvalue = (0.07 * premiumValue)
TextBox6.Text = sumAmount.ToString()
TextBox5.Text = premiumValue.ToString()
TextBox7.Text = vatvalue.ToString()
TextBox9.Text = Math.Round(sumAmount + premiumValue + vatvalue, 2).ToString()
sudeshna from bangkok 17-Aug-13 0:50am    
this is my code where in textboxes all the amt shows,i now want to display currency based on combobox selection

1 solution

Label1.Text = DirectCast(row, System.Data.DataRow)("currency").ToString()
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900