I have been fighting all day with something I apparently have a fundimental misunderstanding of.
I have a gridview (actually about 50 of then generated by CodeSmith). My database has a lot of tables.
I have my templates generating gridviews to just get the basic maintenance up and running quickly. Every aspx page works exactly the same way, Griview, and Add button that opens the formview. All the formviews with no timestamp fields and no integers works fine. formviews with timestamp fields (bascially a binary that's not input) or a nullible integer give me all sorts of errors. The ObjectDataSource look liks this:
<asp:ObjectDataSource ID="EventDivisionDataSource" runat="server"
DataObjectTypeName="Crewstone.Modules.Beletseri.EventDivisionInfo"
DeleteMethod="DeleteEventDivision"
InsertMethod="AddEventDivision"
OldValuesParameterformatString="original_{0}"
SelectMethod="ListEventDivisions"
TypeName="Crewstone.Modules.Beletseri.BeletseriController"
UpdateMethod="UpdateEventDivision"
ConvertNullToDBNull="true">
<SelectParameters>
<asp:Parameter DefaultValue="00" Name="PortalId" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
If the formView has an integer that I put nothing into, BOOM. invalid type messaged for Int16, or Int32. The same deal on timestamps. I saw references to putting in parameters:
<InsertParameters>
<asp:Parameter Name="EventDateId" Type="Int32" ConvertEmptyStringToNull="true" />
<asp:Parameter Name="Priority" Type="Int32" ConvertEmptyStringToNull="true" />
<asp:Parameter Name="PortalId" Type="Int32" ConvertEmptyStringToNull="true" />
<asp:Parameter Name="Sex" Type="String" ConvertEmptyStringToNull="true" />
<asp:Parameter Name="StartAge" Type="Int32" ConvertEmptyStringToNull="true" />
<asp:Parameter Name="EndAge" Type="Int32" ConvertEmptyStringToNull="true" />
<asp:Parameter Name="StartWeight" Type="Int32" ConvertEmptyStringToNull="true" />
<asp:Parameter Name="EndWeight" Type="Int32" ConvertEmptyStringToNull="true" />
<asp:Parameter Name="Survivor" Type="Boolean" ConvertEmptyStringToNull="true" />
<asp:Parameter Name="DivisionId" Type="Int32" ConvertEmptyStringToNull="true" />
<asp:Parameter Name="Division" Type="String" ConvertEmptyStringToNull="true" />
<asp:Parameter Name="Depth" Type="Int32" ConvertEmptyStringToNull="true" />
<asp:Parameter Name="Exclude" Type="Boolean" ConvertEmptyStringToNull="true" />
</InsertParameters>
and I actually put that into my template before it dawned on me that this may or may not map to the classic **info.vb classes that I have. My info classes are using the IHydratable (mostly, some tables have multiple keys so they use the old method) and a normal DAL (not DAL+). if I have to regenerate everythign it's no problem since I've been regerenating all the code about every hour all day. Unfortunately I'm not generating the CORRECT code, and need guidance on how to have nullible integers and binary fields (this are read only, but are needed or concurrancy) in a formview.