I am new in creating reports using crystal reports and c#. I created a c# program which displays clients’ allowance.My only problem for now is that a field is not displaying what I wanted. I have a table in my sql that has a ‘varchar’ data type because I want it to display a number with a text. My problem is that it doesn’t put a comma when a value has a thousand separator. What I want is to display my value as 25,000/day instead of 25000/day. Is it possible to to this? What data type should I use?
Share
There is no data type supporting your requirement in SQL Server.
A better approach would be to use
decimalfor your numbers and a separate column for your text part i.e./day. This will help you run queries requiring averages, minimum, maximum on the decimal field. Later you can format it in C# for your reports.But if you can’t change the database then you may split the string in c# based on character “/” and then you may use ToString() for formatting the number with commas. Something on the following lines: