HighTechTalks DotNet Forums  

DataColumn Format

Dotnet Academic General Discussions microsoft.public.dotnet.academic


Discuss DataColumn Format in the Dotnet Academic General Discussions forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
JMorrell
 
Posts: n/a

Default DataColumn Format - 03-02-2005 , 09:51 AM






Hi all.
I have a situation where I needed to add a new column to a view coming over
from a SQL Server. The code to add the column is as follows:

' new column for Sick Hours Sum
Dim dcSickEndBal As DataColumn = New DataColumn("Ending Sick Balance")
dcSickEndBal.Expression = "begsickbal + sumsickearned - sumsickused"
DsSAL2.vEmpSickLeaveSums.Columns.Add(dcSickEndBal)

...... then when it's displayed .........
' list Sick Leave information
For Each drDetails In draEmployeeSickDetails
For Each dcDetails In drDetails.Table.Columns
details &= dcDetails.ColumnName & ": "
details &= drDetails(dcDetails).ToString
details &= ControlChars.CrLf
Next
details &= ControlChars.CrLf
Next


Within the SQL view I use round() to keep the output to just 2 decimals.
When it appears on my VB output, the formatting that should be taken care of
with round() doesn't seem to happen.

Is there a way to format the DataColumn so I just see 2 decimal places?

I hope this makes sense.

tia,
--
JMorrell

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.