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>
<asp
arameter Name="ACTIVE_FLAG" Type="String" />
<asp
arameter Name="EDIT_DT" Type="DateTime" />
<asp
arameter Name="original_ACTIVE_FLAG" Type="String" />
<asp
arameter 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 =
![Blush :o :o](/styles/default/custom/smilies/blush.gif)
![Blush :o :o](/styles/default/custom/smilies/blush.gif)
![Blush :o :o](/styles/default/custom/smilies/blush.gif)
<UpdateParameters>
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
<asp
![Stick Out Tongue :p :p](/styles/default/custom/smilies/tongue.gif)
</UpdateParameters>
</asp:SqlDataSource>