473,327 Members | 2,081 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,327 software developers and data experts.

Currency in datatable

137 100+
Hello!
I am recieving data from my database and i want to view the data in a datagridview.
So, i wrote the query:
Expand|Select|Wrap|Line Numbers
  1. Dim Sql as String
  2. Sql = "SELECT workorder.ID, merk.merk, type.type, workorder.klacht, CONCAT('€', CONVERT(workorder.totaal, CHAR)) AS totaal
  3.               FROM workorder
  4.               INNER JOIN merk ON workorder.merk_id = merk.id
  5.               INNER JOIN type ON workorder.type_id = type.id
  6.               WHERE klantid = 18 ORDER BY ID"
And then:
Expand|Select|Wrap|Line Numbers
  1. Dim Table As New DataTable
  2. Table = SelectQuery(Sql)
  3.  
  4. DgWorkorder.Datasource = Table
  5. Msgbox(Table.Rows(0).Item("totaal"))
  6.  
  7.  
But in the datagridview and in the messagebox i get for example ?35.00 instead of €35.00
Or better! €35,00

Thanks!
Paul
Jul 31 '11 #1
1 1849
yarbrough40
320 100+
try:
Expand|Select|Wrap|Line Numbers
  1. SELECT '€' + CAST(workorder.totaal as VARCHAR(10)) AS totaal 
you could also append on the ASCII translation &#128 onto the begining of the number when you bind the data to the grid
Aug 2 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Marina | last post by:
Hi, Let's say I have one datatable, that I want to use as the datasource for 2 dropdowns. So both are bound to the same one. But now, when I select a row in dropdown A, the selected row in...
2
by: Newbie | last post by:
Im getting an exception: System.FormatException: Input string was not in a correct format. at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at...
12
by: Ramesh | last post by:
Hi, Pls. answer to this question? Does the position change of the currency manager affect the Dataset. Since I wanted to use the HasChanges method of the dataset to check whether is there any...
5
by: Manuel Canas | last post by:
Hi there, I have a form with a couple of tabs on in and I'm filling the form from a dataset with the fill method. I am using a currency manager for binding controls with a datatable....
2
by: Mika M | last post by:
Hi! My DataSet contains DataTable named as 'CurrencyRates', and it contains fields: 'Currency' (like 'USD'), 'Rate' (like 1.1983) and 'Updated' (date when updated). My application contains...
12
by: Doug Bell | last post by:
Hi, I am having problems trying to create a (temporary) DataTable from a selection from a DataGrid (dgOrders). dtOrdDetails is declared as a Public DataTable Sub is: Dim stFilter as String...
5
by: Theodore | last post by:
Hi, i have a class "MyClass" with a public property of datatable type. I also have a form with a public property of type "MyClass". The form has a datagrid which binds to MyClass.Table datatable....
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.