PC Review


Reply
Thread Tools Rate Thread

DataColumn Format

 
 
=?Utf-8?B?Sk1vcnJlbGw=?=
Guest
Posts: n/a
 
      2nd Mar 2005
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
tried:

details &= drDetails(dcDetails).ToString("N2")

and get the error:

"'Public overrideable function ToString()' has no parameters and its return
type cannot be idexed."

tia,
--
JMorrell
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Format date in datacolumn? =?Utf-8?B?YmVuamk=?= Microsoft ADO .NET 5 20th Aug 2007 09:43 AM
How to format column in datacolumn VISVAMBHAR TRIBANG RAJAT AMOL TANMAY RASIK VISHAL Microsoft ASP .NET 0 1st Sep 2006 01:45 PM
binding datacolumn to another datacolumn in a datagrid bpdace Microsoft C# .NET 0 23rd Nov 2005 03:59 PM
How to format Date Inside DataColumn =?Utf-8?B?UmFlZCBTYXdhbGhh?= Microsoft ASP .NET 1 4th Nov 2004 11:49 AM
DataColumn Format =?Utf-8?B?UmFrZXNo?= Microsoft C# .NET 1 20th Jan 2004 02:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:10 PM.