Beginning ASP.NET 2.0 with C# - Chapter08
Beginning ASP.NET 2.0 with C# - Chapter08 - First Try it out
1. Ch. 8, page 266. Try It Out 2. âadd all of the fields in the checklistâ Should it not read âadd all the columns in the checklistâ?
Does one select the â*â or select all the columns individually?
2. Ch. 8, page 267. Try It Out 2. Select GridView1 âRepeat for the other fields that are not selectedâ What other fields? Do I select all the fields listed in the âavailable fieldsâ list box?
3. Ch. 8, page 267. Try It Out 7. Is one suppose to be able to âUpdateâ the data in this try it out step for if you do attempt to you get this:
Server Error in '/Chapter08' Application.
Updating is not supported by data source 'SqlDataSource1' unless UpdateCommand is specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NotSupportedException: Updating is not supported by data source 'SqlDataSource1' unless UpdateCommand is specified.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NotSupportedException: Updating is not supported by data source 'SqlDataSource1' unless UpdateCommand is specified.]
System.Web.UI.WebControls.SqlDataSourceView.Execut eUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) +210
System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +179
System.Web.UI.WebControls.GridView.HandleUpdate(Gr idViewRow row, Int32 rowIndex, Boolean causesValidation) +1140
System.Web.UI.WebControls.GridView.HandleEvent(Eve ntArgs e, Boolean causesValidation, String validationGroup) +835
System.Web.UI.WebControls.GridView.OnBubbleEvent(O bject source, EventArgs e) +162
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +56
System.Web.UI.WebControls.GridViewRow.OnBubbleEven t(Object source, EventArgs e) +118
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +56
System.Web.UI.WebControls.LinkButton.OnCommand(Com mandEventArgs e) +107
System.Web.UI.WebControls.LinkButton.RaisePostBack Event(String eventArgument) +175
System.Web.UI.WebControls.LinkButton.System.Web.UI .IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +31
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +32
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +244
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3840
________________________________________
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
4. Ch. 8, page 267. How it Works: â<asp:SqlDataSource ID="SqlDataSource1".. UpdateCommand="UPDATE [Fixtures] SET [FixtureDate] = @FixtureDate, [FixtureType] = @FixtureType, [GoalsFor] = @GoalsFor, [GoalsAgainst] = @GoalsAgainst, [Notes] = @Notes, [Opponents] = @Opponents WHERE [FixtureID] = @original_FixtureID">â cannot be found in the source view as it is pointed out in the book.
One cannot find this iether:
<UpdateParameters>
<asp:Parameter Name="FixtureDate" Type="DateTime" />
<asp:Parameter Name="FixtureType" Type="String" />
<asp:Parameter Name="GoalsFor" Type="Int16" />
<asp:Parameter Name="GoalsAgainst" Type="Int16" />
<asp:Parameter Name="Notes" Type="String" />
<asp:Parameter Name="Opponents" Type="String" />
<asp:Parameter Name="original_FixtureID" Type="Int32" />
</UpdateParameters>
|