locked
Please help! Error msg: A ControlID must be specified in ControlParameter 'ID'. RRS feed

  • Question

  • User2038659919 posted

    Apologies, am very new to VB.net code.

    Am just trying to insert my data that is entered into a access data table, i know its something probably quite simple but am i need of help asap

     Thanks

    trav

    Code below: using VB

    Protected Sub LinkButton5_Click1(ByVal sender As Object, ByVal e As System.EventArgs) Handles CompleteButton.Click

    AccessDataSource2.Insert()

    TextBox9.Text = DateAndTime.Now

    TextBox3.Text = Nothing

    Label3.Text = Nothing

    Label2.Text = Nothing

    Casemandropdown.SelectedValue = Nothing

    RemoveButton.Visible = False

    CompleteButton.Visible = False

    Casemandropdown.Enabled = True

    End Sub

     

    <asp:AccessDataSource ID="AccessDataSource2" runat="server"

    DataFile="~/App_Data/Autobots.mdb"

    DeleteCommand="DELETE FROM [Case managment] WHERE [ID] = ?"

    InsertCommand="INSERT INTO [Case managment] ([ID], [Policy_no], [Date], [user_ID], [Case Management], [Case Management Time/Date], [Email], [Email Date/Time], [Arrears Reports], [Arrears Reports Date/Time], [IMA Follow ups (Spreadsheet)], [IMA Follow ups (Spreadsheet) Time/Date], [Follow up database], [Follow up database Time/Date], [Healthscreen U/W letters via email], [Healthscreen U/W letters via email Time/Date], [Phone U/W letters], [Phone U/W letters Date/Time], [Smartguard letters], [Smartguard letters Date/Time], [TSB Follow up], [TSB Follow up Date/Time], [Vax Reports], [Vax Reports Date/Time], [Mail collected and dispersed], [Mail collected and dispersed Date/Time]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"

    SelectCommand="SELECT * FROM [Case managment]"

     

    UpdateCommand="UPDATE [Case managment] SET [Policy_no] = ?, [Date] = ?, [user_ID] = ?, [Case Management] = ?, [Case Management Time/Date] = ?, [Email] = ?, [Email Date/Time] = ?, [Arrears Reports] = ?, [Arrears Reports Date/Time] = ?, [IMA Follow ups (Spreadsheet)] = ?, [IMA Follow ups (Spreadsheet) Time/Date] = ?, [Follow up database] = ?, [Follow up database Time/Date] = ?, [Healthscreen U/W letters via email] = ?, [Healthscreen U/W letters via email Time/Date] = ?, [Phone U/W letters] = ?, [Phone U/W letters Date/Time] = ?, [Smartguard letters] = ?, [Smartguard letters Date/Time] = ?, [TSB Follow up] = ?, [TSB Follow up Date/Time] = ?, [Vax Reports] = ?, [Vax Reports Date/Time] = ?, [Mail collected and dispersed] = ?, [Mail collected and dispersed Date/Time] = ? WHERE [ID] = ?">

    <DeleteParameters>

    <asp:Parameter Name="ID" Type="Int32" />

    </DeleteParameters>

    <UpdateParameters>

    <asp:Parameter Name="Policy_no" Type="Int32" />

    <asp:Parameter Name="Date" Type="DateTime" />

    <asp:Parameter Name="user_ID" Type="String" />

    <asp:Parameter Name="Case_Management" Type="Int32" />

    <asp:Parameter Name="column1" Type="String" />

    <asp:Parameter Name="Email" Type="Int32" />

    <asp:Parameter Name="column2" Type="String" />

    <asp:Parameter Name="Arrears_Reports" Type="Int32" />

    <asp:Parameter Name="column3" Type="String" />

    <asp:Parameter Name="column4" Type="Int32" />

    <asp:Parameter Name="column5" Type="String" />

    <asp:Parameter Name="Follow_up_database" Type="Int32" />

    <asp:Parameter Name="column6" Type="String" />

    <asp:Parameter Name="column7" Type="Int32" />

    <asp:Parameter Name="column8" Type="String" />

    <asp:Parameter Name="column9" Type="Int32" />

    <asp:Parameter Name="column10" Type="String" />

    <asp:Parameter Name="Smartguard_letters" Type="Int32" />

    <asp:Parameter Name="column11" Type="String" />

    <asp:Parameter Name="TSB_Follow_up" Type="Int32" />

    <asp:Parameter Name="column12" Type="String" />

    <asp:Parameter Name="Vax_Reports" Type="Int32" />

    <asp:Parameter Name="column13" Type="String" />

    <asp:Parameter Name="Mail_collected_and_dispersed" Type="Int32" />

    <asp:Parameter Name="column14" Type="String" />

    <asp:Parameter Name="ID" Type="Int32" />

    </UpdateParameters>

    <InsertParameters>

    <asp:ControlParameter Name="ID" Type="Int32" />

    <asp:ControlParameter ControlID="Label2" Name="Policy_no" PropertyName="Text"

    Type="Int32" />

    <asp:ControlParameter ControlID="TextBox8" Name="Date" PropertyName="Text"

    Type="DateTime" />

    <asp:ControlParameter ControlID="TextBox10" Name="user_ID" PropertyName="Text"

    Type="String" />

    <asp:ControlParameter ControlID="Casemandropdown" Name="Case_Management"

    PropertyName="SelectedValue" Type="Int32" />

    <asp:Parameter Name="column1" Type="String" />

    <asp:ControlParameter ControlID="Casemandropdown" Name="Email"

    PropertyName="SelectedValue" Type="Int32" />

    <asp:Parameter Name="column2" Type="String" />

    <asp:ControlParameter ControlID="Casemandropdown" Name="Arrears_Reports"

    PropertyName="SelectedValue" Type="Int32" />

    <asp:Parameter Name="column3" Type="String" />

    <asp:Parameter Name="column4" Type="Int32" />

    <asp:Parameter Name="column5" Type="String" />

    <asp:Parameter Name="Follow_up_database" Type="Int32" />

    <asp:Parameter Name="column6" Type="String" />

    <asp:Parameter Name="column7" Type="Int32" />

    <asp:Parameter Name="column8" Type="String" />

    <asp:Parameter Name="column9" Type="Int32" />

    <asp:Parameter Name="column10" Type="String" />

    <asp:Parameter Name="Smartguard_letters" Type="Int32" />

    <asp:Parameter Name="column11" Type="String" />

    <asp:Parameter Name="TSB_Follow_up" Type="Int32" />

    <asp:Parameter Name="column12" Type="String" />

    <asp:Parameter Name="Vax_Reports" Type="Int32" />

    <asp:Parameter Name="column13" Type="String" />

    <asp:Parameter Name="Mail_collected_and_dispersed" Type="Int32" />

    <asp:Parameter Name="column14" Type="String" />

    </InsertParameters>

    </asp:AccessDataSource>

    Sunday, January 18, 2009 6:12 PM

Answers

  • User-1360095595 posted

    This line doesn't provide a ControlId:

    <asp:ControlParameter Name="ID" Type="Int32" />

    If your ID column in an identity column, then you need not specify it in the insert command.  If it's not an identity column, you may need to change it to a Parameter field, and set it in the codebehind or something like that.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, January 18, 2009 9:15 PM