Solved

Format Code for phone number in VS.NET

Posted on 2006-06-20
8
274 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
Comment Utility
Do you mean Mask?
0
 
LVL 10

Expert Comment

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

Author Comment

by:jjrr007
Comment Utility
In VS.NET properties window.

For Example, format code N0 is numbers without a decimal point.  I have raised the points level.  
0
 
LVL 10

Expert Comment

by:vadim63
Comment Utility
My guess - you can not do it without mask. Sorry.
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 96

Expert Comment

by:Bob Learned
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now