Storing SQL data from dotnet...

  • Thread starter Thread starter Chris Marsh
  • Start date Start date
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
 
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
 
Hey thanks for the response. Yes, the app is written in C#. Do you have an
example for me?

Chris
 
Back
Top