Sorry, the database stores the number as nvarch type without any
formatting.  I want to display the number in a formatted state such as
(xxx) xxx-xxxx.  I have looked for how to do this in the asp
formatting text and did get it to work, but had an issue when there
was a null value in the table.  I have tried the following:

<asp:Label ID="PhoneLabel" runat="server"
     Text='<%@ String.Format("{);(###) ###-####}",
Convert.ToInt64(DataBinder.Eval(Container.DataItem, "BillingPhone")))
%>' />

It gives me the following error:
  FormatException was unhandled by user code.  Input string was not in
a correct format.

I may be trying to do something either the hard way or in a way that
is not possible.

On Oct 12, 11:59 am, Mike Fry <[email protected]> wrote:
> On 2010/10/12 18:06, BD wrote:
>
> > Working with sql server back end that allows nulls, trying to get the
> > label of a US Phone Number to display in a Label on a FormView.  My
> > page has two formviews that have phone numbers in them.  My attempts
> > have not worked.
>
> Telling (or showing) us what's going wrong would be a start.
>
> --
> Regards,
> Mike Fry
> Johannesburg

Reply via email to