【发布时间】:2012-03-07 20:39:54
【问题描述】:
我有一个存储电话号码的文本框。
<asp:TextBox runat="server" ID="phone" MaxLength="10" Columns="10" Width="90px" />
<asp:MaskedEditExtender ID="phone_MaskedEditExtender" runat="server" CultureAMPMPlaceholder=""
CultureCurrencySymbolPlaceholder="" CultureDateFormat="" CultureDatePlaceholder=""
CultureDecimalPlaceholder="" CultureThousandsPlaceholder="" CultureTimePlaceholder=""
Enabled="True" TargetControlID="phone" Mask="(999)-999-9999" ClearMaskOnLostFocus="False">
</asp:MaskedEditExtender>
问题是当我插入电话号码 9999999999 时,数据库中的号码变成 (999)-9999。 我想要的是9999999999。 另一个代码是:
<asp:SqlDataSource ID="InsertExtraInfo" runat="server" ConnectionString="<%$ ConnectionStrings:MembershipDB %>"
InsertCommand="CreateAdditionalAccountInfo" InsertCommandType="StoredProcedure">
<InsertParameters>
<asp:ControlParameter Name="FirstName" Type="String" ControlID="FirstName" PropertyName="Text" />
<asp:ControlParameter Name="LastName" Type="String" ControlID="LastName" PropertyName="Text" />
<asp:ControlParameter Name="Degree" Type="String" ControlID="Degree" PropertyName="Text" />
<asp:ControlParameter Name="Organization" Type="String" ControlID="Organization"
PropertyName="Text" />
<asp:ControlParameter Name="Phone" Type="String" ControlID="Phone" PropertyName="Text" />
<asp:ControlParameter Name="Ext" Type="String" ControlID="Ext" PropertyName="Text" />
<asp:ControlParameter Name="last4SSN" Type="String" ControlID="TextSSN" PropertyName="Text" />
</InsertParameters>
</asp:SqlDataSource>
存储过程查询是
INSERT INTO [User_ExtraInfo] ([UserId], [FirstName], [LastName], [Degree], [Organization], [Phone], [Ext], [last4SSN],[Trained]) VALUES (@UserId, @FirstName, @LastName, @Degree, @Organization, @Phone, @Ext
谢谢。
【问题讨论】:
标签: c# asp.net sql-server tsql