Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am facing these 2 errors which state that:
SQL
Error   1   'ASP.appointment_booknewappointment_aspx' does not contain a definition for 'OnSqlUpdated' and no extension method 'OnSqlUpdated' accepting a first argument of type 'ASP.appointment_booknewappointment_aspx' could be found (are you missing a using directive or an assembly reference?)Appointment\Appointment\BookNewAppointment.aspx    96


SQL
Error   2   'ASP.appointment_booknewappointment_aspx' does not contain a definition for 'OnSqlUpdating' and no extension method 'OnSqlUpdating' accepting a first argument of type 'ASP.appointment_booknewappointment_aspx' could be found (are you missing a using directive or an assembly reference?)Appointment\Appointment\BookNewAppointment.aspx    96


My codes seems to be fine but when i run, these 2 errors are shown. I do not really understand as it is my first time trying asp.net transaction.

Here is my .aspx code
C#
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
           ConnectionString="<%$ ConnectionStrings:BORosesConnection %>"
           DeleteCommand="DELETE FROM [Appointment] WHERE [ApptID] = @ApptID"
           InsertCommand="INSERT INTO [Appointment] ([ApptDate], [ApptStartTime], [ApptEndTime], [WeddingPlanner]) VALUES (@ApptDate, @ApptStartTime, @ApptEndTime, @WeddingPlanner)"
           SelectCommand="SELECT * FROM [Appointment]"
           UpdateCommand="UPDATE [Appointment] SET [ApptDate] = @ApptDate, [ApptStartTime] = @ApptStartTime, [ApptEndTime] = @ApptEndTime, [WeddingPlanner] =  @WeddingPlanner WHERE [ApptID] = @ApptID" DataSourceMode="DataReader" OnUpdated="OnSqlUpdated" OnUpdating="OnSqlUpdating">
           <SelectParameters>
           <asp:QueryStringParameter Name="ApptID"
           QueryStringField="AID" Type="Int32" />
           </SelectParameters>
           <DeleteParameters>
               <asp:QueryStringParameter Name="ApptID" QueryStringField="AID" Type="Int32" />
           </DeleteParameters>
           <InsertParameters>
               <asp:ControlParameter Name="ApptDate" ControlId="TextBox1" Type="String" />
               <asp:ControlParameter Name="ApptStartTime" ControlId="ddlStart" Type="String" />
               <asp:ControlParameter Name="ApptEndTime" ControlId="ddlEnd" Type="String" />
               <asp:ControlParameter Name="WeddingPlanner" ControlId="weddingPlanner" Type="String" />
           </InsertParameters>
           <UpdateParameters>
               <asp:ControlParameter Name="ApptDate" ControlId="TextBox1" Type="String" />
               <asp:ControlParameter Name="ApptStartTime" ControlId="ddlStart" Type="String" />
               <asp:ControlParameter Name="ApptEndTime" ControlId="ddlEnd" Type="String" />
               <asp:ControlParameter Name="WeddingPlanner" ControlId="weddingPlanner" Type="String" />
               <asp:QueryStringParameter Name="ApptID" QueryStringField="AID" Type="Int32" />
           </UpdateParameters>
       </asp:SqlDataSource>
Posted
Updated 11-Jul-12 5:18am
v2
Comments
[no name] 11-Jul-12 11:11am    
Just what it says. You are trying to call 2 functions that do not exist in your ASP.appointment_booknewappointment_aspx file. If they do exist you need to add the references for them.
kellycx 11-Jul-12 11:17am    
What do they mean by assembly reference?

I have added the 2 functions under my SqlDataSource in the .aspx and in my .cs file. Is that considered as references?
[no name] 11-Jul-12 11:20am    
They mean adding a reference to the DLL that contains the definitions for those functions. In this case, Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
kellycx 11-Jul-12 11:40am    
Alright, Thanks for your help! I managed to write off those errors. Thank You!
[no name] 11-Jul-12 22:57pm    
You're welcome

1 solution

To take this off the unanswered list

Just what it says. You are trying to call 2 functions that do not exist in your ASP.appointment_booknewappointment_aspx file. If they do exist you need to add the references for them.

They mean adding a reference to the DLL that contains the definitions for those functions. In this case, Namespace: System.Web.UI.WebControls Assembly: System.Web (in System.Web.dll)
 
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