Click here to Skip to main content
16,018,318 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Exception Details: System.Web.HttpException: DataBinding: 'DatePickerControl.DatePicker' does not contain a property with the name 'SelectedDate'.

Source Error:

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

This error appear when I hit "create user" button of the createuserwizard. I was thinking maybe I can't store the datepicker into my sqldatasource.

This is my html code:
XML
<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="DateTime" ControlID="WedDate" PropertyName="SelectedDate"/>
      </InsertParameters>

  </asp:SqlDataSource>



here is code for datapicker:
XML
<td class="style1">
                             <cc1:DatePicker ID="WedDate" runat="server" CalendarDate=""
                                 TextCssClass="" />
                             <asp:RequiredFieldValidator ID="RequiredFieldValidator17" runat="server" ControlToValidate="WedDate"
                                 ErrorMessage="Wedding date required"/>
                         </td>
Posted

1 solution

Soooo...whos DatePicker control are you using? It's pretty obvious from the error message that it doesn't expose a "SelectedDate" property. I don't know what to tell you, other than read the documentation on the control and see what the property name actually is and modify your ControlParameter ProeprtyName field to match it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900