Formating Data Column in the Data Table

  • Thread starter Thread starter Mark Vergara
  • Start date Start date
M

Mark Vergara

Is there any way of converting a particular data column or
to another data type just like for example in the SQL Server programming
that returns the number of decimal places?

----------------------------------------------------------------------------
--
example SQL Server Coding..

DECLARE @myval decimal (5, 2)
SET @myval = 193.57
SELECT CAST(CAST(@myval AS varbinary(20)) AS decimal(10,5))
-- Or, using CONVERT

SELECT CONVERT(decimal(10,5), CONVERT(varbinary(20), @myval))

it returns 5 decimal place

193.57000

----------------------------------------------------------------------------
-

Example VB.Net Coding

myDataColumn.Expression="Convert(total, 'System.Decimal')"

How can I return my data Column expression with a specified number of
decimal places ?
 
You can use DataGridTextBoxColumn.Format property for formatting the
contents of your column
 
Back
Top