Chapt 8 Try it out (Inserting).. Page 273
I am having some problems with the try it out on page 273 of chapter 8. My code looks the same as it does on page 275 of the how it works.
The record just isn't going into the database. No error or anything. I have refreshed the page and looked in the database and the record doesn't get created. If I try and put in garbage for the date, I get an error.
Here are some snippets of code:
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:WroxUnitedConnectionString %>"
InsertCommand="INSERT INTO [Fixtures] ([FixtureDate], [FixtureType], [GoalsFor], [GoalsAgainst], [Opponents], [Notes]) VALUES (@FixtureDate, @FixtureType, @GoalsFor, @GoalsAgainst, @Opponents, @Notes)"
<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="Opponents" Type="String" />
<asp:Parameter Name="Notes" Type="String" />
</InsertParameters>
I have monkeyed around with a few settings here and there.. with no luck.
Thanks,
Rob
|