Here is my page:
<%@ Page Language="C#" MasterPageFile="~/site.master" AutoEventWireup="true" CodeFile="Fixtures.aspx.cs" Inherits="Fixtures" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="mainContent" Runat="Server">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="FixtureID"
DataSourceID="SqlDataSource1" EmptyDataText="There are no data records to display.">
<Columns>
<asp:CommandField ShowSelectButton="True" ShowEditButton="True" ShowDeleteButton="True" />
<asp:BoundField DataField="FixtureID" HeaderText="FixtureID" ReadOnly="True" SortExpression="FixtureID" />
<asp:BoundField DataField="FixtureDate" HeaderText="FixtureDate" SortExpression="FixtureDate" />
<asp:BoundField DataField="FixtureType" HeaderText="FixtureType" SortExpression="FixtureType" />
<asp:BoundField DataField="GoalsFor" HeaderText="GoalsFor" SortExpression="GoalsFor" />
<asp:BoundField DataField="GoalsAgainst" HeaderText="GoalsAgainst" SortExpression="GoalsAgainst" />
<asp:BoundField DataField="Notes" HeaderText="Notes" SortExpression="Notes" />
<asp:BoundField DataField="Opponents" HeaderText="Opponents" SortExpression="Opponents" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:WroxUnitedConnectionString %>"
ProviderName="<%$ ConnectionStrings:WroxUnitedConnectionString1.Prov iderName %>"
SelectCommand="SELECT [FixtureType], [FixtureID], [FixtureDate], [GoalsFor], [GoalsAgainst], [Notes], [Opponents] FROM [Fixtures]" DeleteCommand="DELETE FROM [Fixtures] WHERE [FixtureID] = @FixtureID" InsertCommand="INSERT INTO [Fixtures] ([FixtureType], [FixtureDate], [GoalsFor], [GoalsAgainst], [Notes], [Opponents]) VALUES (@FixtureType, @FixtureDate, @GoalsFor, @GoalsAgainst, @Notes, @Opponents)" UpdateCommand="UPDATE [Fixtures] SET [FixtureType] = @FixtureType, [FixtureDate] = @FixtureDate, [GoalsFor] = @GoalsFor, [GoalsAgainst] = @GoalsAgainst, [Notes] = @Notes, [Opponents] = @Opponents WHERE [FixtureID] = @FixtureID">
<DeleteParameters>
<asp:Parameter Name="FixtureID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="FixtureType" Type="String" />
<asp:Parameter Name="FixtureDate" Type="DateTime" />
<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="FixtureID" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="FixtureType" Type="String" />
<asp:Parameter Name="FixtureDate" Type="DateTime" />
<asp:Parameter Name="GoalsFor" Type="Int16" />
<asp:Parameter Name="GoalsAgainst" Type="Int16" />
<asp:Parameter Name="Notes" Type="String" />
<asp:Parameter Name="Opponents" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="FixtureID"
DataSourceID="SqlDataSource2" Height="50px" Width="450px" DefaultMode="Insert">
<Fields>
<asp:BoundField DataField="FixtureID" HeaderText="FixtureID" InsertVisible="False"
ReadOnly="True" SortExpression="FixtureID" />
<asp:BoundField DataField="FixtureDate" HeaderText="FixtureDate" SortExpression="FixtureDate" />
<asp:BoundField DataField="FixtureType" HeaderText="FixtureType" SortExpression="FixtureType" />
<asp:BoundField DataField="GoalsFor" HeaderText="GoalsFor" SortExpression="GoalsFor" />
<asp:BoundField DataField="GoalsAgainst" HeaderText="GoalsAgainst" SortExpression="GoalsAgainst" />
<asp:BoundField DataField="Notes" HeaderText="Notes" SortExpression="Notes" />
<asp:BoundField DataField="Opponents" HeaderText="Opponents" SortExpression="Opponents" />
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True" />
</Fields>
</asp:DetailsView>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:WroxUnited %>"
SelectCommand="SELECT [FixtureID], [FixtureDate], [FixtureType], [GoalsFor], [GoalsAgainst], [Notes], [Opponents] FROM [Fixtures]"
ConflictDetection="CompareAllValues"
DeleteCommand="DELETE FROM [Fixtures] WHERE [FixtureID] = @original_FixtureID AND [FixtureDate] = @original_FixtureDate AND [FixtureType] = @original_FixtureType AND [GoalsFor] = @original_GoalsFor AND [GoalsAgainst] = @original_GoalsAgainst AND [Notes] = @original_Notes AND [Opponents] = @original_Opponents"
InsertCommand="INSERT INTO [Fixtures] ([FixtureDate], [FixtureType], [GoalsFor], [GoalsAgainst], [Notes], [Opponents]) VALUES (@FixtureDate, @FixtureType, @GoalsFor, @GoalsAgainst, @Notes, @Opponents)"
OldValuesParameterFormatString="original_{0}"
UpdateCommand="UPDATE [Fixtures] SET [FixtureDate] = @FixtureDate, [FixtureType] = @FixtureType, [GoalsFor] = @GoalsFor, [GoalsAgainst] = @GoalsAgainst, [Notes] = @Notes, [Opponents] = @Opponents WHERE [FixtureID] = @original_FixtureID AND [FixtureDate] = @original_FixtureDate AND [FixtureType] = @original_FixtureType AND [GoalsFor] = @original_GoalsFor AND [GoalsAgainst] = @original_GoalsAgainst AND [Notes] = @original_Notes AND [Opponents] = @original_Opponents">
<DeleteParameters>
<asp:Parameter Name="original_FixtureID" Type="Int32" />
<asp:Parameter Name="original_FixtureDate" Type="DateTime" />
<asp:Parameter Name="original_FixtureType" Type="String" />
<asp:Parameter Name="original_GoalsFor" Type="Int16" />
<asp:Parameter Name="original_GoalsAgainst" Type="Int16" />
<asp:Parameter Name="original_Notes" Type="String" />
<asp:Parameter Name="original_Opponents" Type="String" />
</DeleteParameters>
<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" />
<asp:Parameter Name="original_FixtureDate" Type="DateTime" />
<asp:Parameter Name="original_FixtureType" Type="String" />
<asp:Parameter Name="original_GoalsFor" Type="Int16" />
<asp:Parameter Name="original_GoalsAgainst" Type="Int16" />
<asp:Parameter Name="original_Notes" Type="String" />
<asp:Parameter Name="original_Opponents" Type="String" />
</UpdateParameters>
<InsertParameters>
<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" />
</InsertParameters>
</asp:SqlDataSource>
</asp:Content>
|