Storing SQL data from dotnet...

C

Chris Marsh

Hi,

We are taking information in a simple sales prospect entry form on our web
site via asp.net, we want to capture accurate data so we have included the
following expression validator:

<asp:regularexpressionvalidator id="Regularexpressionvalidator1"
ValidationExpression="((\(\d{3}\)?)|(\d{3}-))?\d{3}-\d{4}"Runat="server"
ErrorMessage="Enter a valid office phone number"
ControlToValidate="txtOfficePhone"></asp:regularexpressionvalidator>

It works perfectly making sure that the number is entered in (999)555-1212,
of course preventing the garbage data we had before however the problem is
that we don't actually want the masks ()-- stored in the SQL table.

Is there a way that I can strip the mask out before it gets to SQL data
table either with a trigger or with something on the ASP.net side? Does
someone have an example to help me with?

Thanks,

Chris
 
W

WizyDig

This can be accomplished in the code behind page at postback before you save
the data to the database. Are you using code behind pages?
-wiz
 
C

Chris Marsh

Hey thanks for the response. Yes, the app is written in C#. Do you have an
example for me?

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top