Solved

Format Code for phone number in VS.NET

Posted on 2006-06-20
8
276 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
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

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

773 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