SqlDataSource UpdateCommand

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 =
:blush:riginal_EDIT_ID and active_flag = :blush:riginal_active_flag and edit_dt =
:blush:riginal_EDIT_DT'>
<UpdateParameters>
<asp:parameter Name="ACTIVE_FLAG" Type="String" />
<asp:parameter Name="EDIT_DT" Type="DateTime" />
<asp:parameter Name="original_ACTIVE_FLAG" Type="String" />
<asp:parameter Name="original_EDIT_DT" Type="DateTime" />
</UpdateParameters>
</asp:SqlDataSource>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top