473,499 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Display format of character columns in a gridview like Access?

I have a character(15) column filled with numbers, in my SQL database. I need
it to display like it does in Access when I set a format for the column, like
"000-000-000-000-000". How do I display the values the same way in a gridview
column? I can't manage to set the DataformatString properly.

TIA

Aug 26 '08 #1
2 2099
What format doesn't work that you have tried for the DataFormatString
property?

David Wier
http://aspnet101.com
http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup
"Savvoulidis Iordanis" <Sa*****************@discussions.microsoft.comwrot e
in message news:C5**********************************@microsof t.com...
>I have a character(15) column filled with numbers, in my SQL database. I
need
it to display like it does in Access when I set a format for the column,
like
"000-000-000-000-000". How do I display the values the same way in a
gridview
column? I can't manage to set the DataformatString properly.

TIA

Aug 26 '08 #2
I tried the following for DataFormatString:

{0:00000-00000-00000}
{0:"00000-00000-00000"}
{0:00000\-00000\-00000}
{0:99999-99999-99999}

What I want is to display the character data 123451234512345 as
12345-12345-12345

Aug 26 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1505
by: Alex Maghen | last post by:
Hi. I have a whole bunch of queries that I'll be running and returning in OleDbDataReader objects. Some of these DataReaders will just be a simple singe table result and others will be more complex...
3
11696
by: AG | last post by:
Below is code (slightly modified and converted to VB) that was provided to me in response to another post. I am using it to demonstrate another problem. In order for paging and other features to...
2
11989
by: j.m.osterman | last post by:
I haven't found exactly what I've been trying to do. All I am trying to do for now is just display usernames from Active Directory into a ListBox control on a page. I have found some code...
1
1331
by: Martin.Coetsee | last post by:
Fellow developers, I need to find out how to display one of the fields listed in my gridview as a hyperlink. The field displays the physical file path of for example a pdf file. I want my users to...
0
1008
by: mark4asp | last post by:
This is the solution to the problem I had !! I thought I'd post this here because I had so much trouble figuring out what was wrong with my code! Data is stored in a cached view which is bound...
3
7758
by: =?Utf-8?B?bmt3?= | last post by:
I have a gridview which need to filled by various data according to user's action. I want to format the dynamical displayed data. For example the number should be right aligned, datetime column...
2
4110
by: J055 | last post by:
Hi I need to search a number of DataTables within a DataSet (with some relationships) and then display the filtered results in a GridView. The Columns that need to be displayed come from 2 of...
1
2207
by: tuman | last post by:
I am making a project which is related to classified web site. I have used a gridview control. In which put some sqltable data. And i want to show a image which is store in my project folder,...
19
3912
by: Mel | last post by:
I want to display custom data in some sort of control on a web page. By custom data I mean it's not in a database yet it just resides in a List Box on a different tab . I just want to display the...
0
7007
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7171
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7220
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
4918
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4599
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3098
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
664
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
295
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.