473,320 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

FormatString

I am trying to format a social security number displayed on a Win form. The
text box that holds the ssn is bound to a data set. I tried the code below
in the form's OnLoad event; however, it doesn't work.

Binding ssnBinding;
ssnBinding = sSNTextBox.DataBindings["Text"];
ssnBinding.FormatString = "000'-'00'-'0000";
ssnBinding.FormattingEnabled = true;

Any help will be greatly appreciated. Thanks.
Feb 15 '08 #1
1 2839
What's the deal with the single quotes? Are those really in your format
string? Does it work if you take them out?

RobinS.
------------------------------
"Weste" <We***@discussions.microsoft.comwrote in message
news:2F**********************************@microsof t.com...
>I am trying to format a social security number displayed on a Win form.
The
text box that holds the ssn is bound to a data set. I tried the code
below
in the form's OnLoad event; however, it doesn't work.

Binding ssnBinding;
ssnBinding = sSNTextBox.DataBindings["Text"];
ssnBinding.FormatString = "000'-'00'-'0000";
ssnBinding.FormattingEnabled = true;

Any help will be greatly appreciated. Thanks.
Feb 16 '08 #2

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

Similar topics

1
by: revolnip | last post by:
As attached is the code : <% Option Explicit dim lngTimer lngTimer = Timer %> <!--#include file="Connect.asp" --> <!--#include file="Settings.asp" --> <!--#include file="Common.asp" -->
0
by: Andreas Klemt | last post by:
Hello, when I do this FormatString("3333.50", "{0:N2}") I get: 3.333,50 What to do to get this: 3333.50 (without a dot) Thanks, Andreas
0
by: Souri Challa | last post by:
Is there a simple way to set the datagrid footer columns format strings to be the same as the bound column data format string ? Thanks, Souri
4
by: Richard Carpenter | last post by:
I have a simple gridview control contained in a panel in a web user control. One of the columns in the gridview is of type SQLDateTime. I would like to strip off the time portion of the DateTime...
3
by: JJ | last post by:
I want to display a number as 3 digits, i.e.: '3' would appear as '003' '45' would appear as '045' I just wondered whether you could do this with a format string: <asp:Label...
0
by: timnels | last post by:
I wanted to created a formatted label control. I know I can add a property to hold the FormatString, but I am not sure what method to override to do the formatting. Any ideas?
0
by: LieWait | last post by:
I wanted to created a formatted label control. I know I can add a property to hold the FormatString, but I am not sure what method to override to do the formatting. Any ideas?
0
ammoos
by: ammoos | last post by:
Hi friends I need to format the datagrid columns in many ways 1)In first column, values are to be displayed as integers with no decimal places and the thousands separator is ‘.’ ...
7
by: Steve K | last post by:
First problem: I am specifying a format string for a Binding object like so: <code> Binding binding = new Binding("Text", item.EOBRemittance, "AmountAllowed", true, DataSourceUpdateMode.Never,...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.