Solved

Format Code for phone number in VS.NET

Posted on 2006-06-20
8
278 Views
Last Modified: 2012-08-13
Experts,

I am working in a VS.NET file.  I wanted to ask the format code for a phone number in VS.NET?

Thanks.
0
Comment
Question by:jjrr007
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 10

Expert Comment

by:vadim63
ID: 16943698
Do you mean Mask?
0
 
LVL 10

Expert Comment

by:vadim63
ID: 16943749
If mask, it could be
(999) 000-0000
0
 
LVL 1

Author Comment

by:jjrr007
ID: 16944997
In VS.NET properties window.

For Example, format code N0 is numbers without a decimal point.  I have raised the points level.  
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Expert Comment

by:vadim63
ID: 16945260
My guess - you can not do it without mask. Sorry.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16945425
Try this for U.S. phone numbers:

  Dim n As Integer = 1234567890
  Dim s As String = n.ToString("(000) 000-0000")

Bob
0
 
LVL 1

Author Comment

by:jjrr007
ID: 16945639
I am using the MS Reporting Reporting Services Module in VS.NET.  

The data type is Teradata.  So using VB.NET code won't work like this without a whole lot of work.  The options that I have (that I know of area):

Change the format box from the properties window.
Change the query in Teradata
Use Transact SQL code- directly in VS.NET Reporting Services 2003


Please advise.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16945664
Good thing that you clarified that.  Good luck finding an answer :D

Bob
0
 
LVL 2

Accepted Solution

by:
Bill_PSC earned 500 total points
ID: 16962156
You may try creating a seperate class to handle the format.

ie:

 Public Sub FormatPhone(ByVal sender As Object, ByVal e As ConvertEventArgs)
        Dim ph As String
        Try
            ph = e.Value
         e.Value = "(" + ph.Substring(0, 3) + ") " + ph.Substring(3, 3) + "-" + ph.Substring(6, 4)
        Catch
            e.Value = "Not Entered"
        End Try
    End Sub

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question