M
Mike J.
Hi,
I'm having trouble updating an Oracle database table using SqlDataSource and
a Gridview when I include a date field. It works fine without the date
field, but when I put the date field in, I get errors.
What is the syntax and/or method to update a date field? How is the date
formatted from the Gridview's textbox to the UpdateComand of the
SqlDataSource?
<asp:SqlDataSource ID="EditGrid" runat="server"
ConflictDetection="ComareAllValues" ConnectionString="<%$ ... %>"
UpdateCommand='Update EditTable set active_flag = :ACTIVE_FLAG, edit_dt
= to_date(":EDIT_DT", "MM/DD/YYYY HH:MI:SS PM") where edit_id =
riginal_EDIT_ID and active_flag = riginal_active_flag and edit_dt =
riginal_EDIT_DT'>
<UpdateParameters>
<asparameter Name="ACTIVE_FLAG" Type="String" />
<asparameter Name="EDIT_DT" Type="DateTime" />
<asparameter Name="original_ACTIVE_FLAG" Type="String" />
<asparameter Name="original_EDIT_DT" Type="DateTime" />
</UpdateParameters>
</asp:SqlDataSource>
I'm having trouble updating an Oracle database table using SqlDataSource and
a Gridview when I include a date field. It works fine without the date
field, but when I put the date field in, I get errors.
What is the syntax and/or method to update a date field? How is the date
formatted from the Gridview's textbox to the UpdateComand of the
SqlDataSource?
<asp:SqlDataSource ID="EditGrid" runat="server"
ConflictDetection="ComareAllValues" ConnectionString="<%$ ... %>"
UpdateCommand='Update EditTable set active_flag = :ACTIVE_FLAG, edit_dt
= to_date(":EDIT_DT", "MM/DD/YYYY HH:MI:SS PM") where edit_id =
riginal_EDIT_ID and active_flag = riginal_active_flag and edit_dt =
riginal_EDIT_DT'>
<UpdateParameters>
<asparameter Name="ACTIVE_FLAG" Type="String" />
<asparameter Name="EDIT_DT" Type="DateTime" />
<asparameter Name="original_ACTIVE_FLAG" Type="String" />
<asparameter Name="original_EDIT_DT" Type="DateTime" />
</UpdateParameters>
</asp:SqlDataSource>