Details View Doesn't Update

M

MU

Hi all,

I have a DetailsView object on my form with the following Template

<asp:TemplateField HeaderText="Start Date"
SortExpression="StartDate">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server"
Text='<%# Eval("StartDate", "{0:MMMM d, yyyy}") %>'></
asp:TextBox><cc1:CalendarExtender
ID="calExtender_StartDate"
runat="server" TargetControlID="TextBox1" Format="MMMM d, yyyy">
</cc1:CalendarExtender>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox1" runat="server"
Text='<%# Eval("StartDate", "{0:MMMM d, yyyy}") %>' ReadOnly="true"></
asp:TextBox><cc1:CalendarExtender
ID="calExtender_EndDate"
runat="server" TargetControlID="TextBox1" Format="MMMM d, yyyy">
</cc1:CalendarExtender>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server"
Text='<%# Eval("StartDate", "{0:MMMM d, yyyy}") %>'></asp:Label>
</ItemTemplate>
<ControlStyle CssClass="form_textbox_15" />
</asp:TemplateField>

When I click Edit and then add a date using the Calendar control it
adds the date to the text box and when I click Update, no error occur
but the value isn't written to the database, it goes in as blank.

Thoughts? Here is my update statement for the SQLDataSource

UpdateCommand="UPDATE ParticipantItems SET Name = @Name,
Quantity = @Quantity, StartDate = @StartDate, EndDate = @EndDate,
Comments = @Comments, DateUpdated = GETDATE(), AdminID = 1 WHERE
(ItemID = @ItemID)">

Thanks
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top