1

我尝试使用日期/时间、时间,但没有帮助。

异常详细信息:System.Web.HttpException:DataBinding:“DatePickerControl.DatePicker”不包含名为“Text”的属性。

Source Error: 


Line 31:         DataSource.InsertParameters.Add("UserId", UserGUID.ToString());
Line 32: 
Line 33:         DataSource.Insert();//here is the error
Line 34:         
Line 35:     }

这是html代码:

<asp:SqlDataSource ID="InsertExtraInfo" runat="server" ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString1 %>"
    InsertCommand="INSERT INTO [UserDetails] ([UserId], [CustName], [CustNum], [CustRole], [CustStatus], [PName], [PEmail], [PRole], [WedDate]) VALUES (@UserId, @CustName, @CustNum, @CustRole, @CustStatus, @PName, @PEmail, @PRole, @WedDate)"
    ProviderName="<%$ ConnectionStrings:ASPNETDBConnectionString1.ProviderName %>">
    <InsertParameters>
        <asp:ControlParameter Name="CustName" Type="String" ControlID="CustName" PropertyName="Text" />
        <asp:ControlParameter Name="CustNum" Type="String" ControlID="CustNum" PropertyName="Text" />
        <asp:ControlParameter Name="CustRole" Type="String" ControlID="CustRole" PropertyName="Text" />
        <asp:ControlParameter Name="CustStatus" Type="String" ControlID="CustStatus" PropertyName="Text" />
        <asp:ControlParameter Name="PName" Type="String" ControlID="PName" PropertyName="Text" />
        <asp:ControlParameter Name="PEmail" Type="String" ControlID="PEmail" PropertyName="Text" />
        <asp:ControlParameter Name="PRole" Type="String" ControlID="PRole" PropertyName="Text" />
        <asp:ControlParameter Name="WedDate" Type="String" ControlID="WedDate" PropertyName="Text"/>
    </InsertParameters>

</asp:SqlDataSource>
4

2 回答 2

0

设置PropertyName="SelectedValue"Type="DateTime"

<asp:ControlParameter Name="WedDate" Type="DateTime" ControlID="WedDate" PropertyName="SelectedValue"/>

编辑:

尝试

<asp:ControlParameter Name="WedDate" Type="DateTime" ControlID="WedDate" PropertyName="SelectedDate"/>
于 2012-06-19T18:36:35.780 回答
0

改变

Type="String"toType="DateTime"
PropertyName="Text"toPropertyName="SelectedDate" 在这条线上

<asp:ControlParameter Name="WedDate" Type="DateTime" ControlID="WedDate" PropertyName="SelectedDate" />
于 2012-06-19T18:42:03.833 回答