Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > DetailsView UpdateCommand

Reply
Thread Tools

DetailsView UpdateCommand

 
 
Andre
Guest
Posts: n/a
 
      01-24-2006
Hi,

I need some help with an UpdateCommand syntax.

Everything is ok with the major part of my update (if i don't use my
calendar).
For the Date field i use a Calendar, and i can't find a way to update my
DB with the new date.

Did someone have any answer or a palce where i can get some information
on this ?

Heres's my code :

[...]
<asp:TemplateField HeaderText="Begin_Date">
<EditItemTemplate>
<asp:Calendar ID="Calendar1" runat="server" SelectedDate='<%#
Bind("begin_date") %>' VisibleDate='<%# Bind("begin_date") %' />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("begin_date",
"{0:d}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
[...]
<asp:SqlDataSource id="sqlDetail" runat=server
ConnectionString="<%$ConnectionStrings:SysAnnonces ConnectionString %>"
SelectCommand="SELECT * FROM Adds WHERE NoAuto=@noAuto"
UpdateCommand="UPDATE Adds SET Name = @Name, begin_date =
@calendar1.selecteddate WHERE noAuto = @NoAuto">
</asp:SqlDataSource>
[...]


 
Reply With Quote
 
 
 
 
Andre
Guest
Posts: n/a
 
      01-25-2006
Problem's solved... i changed VisibleDate='<%# Bind("begin_date") %>' by
VisibleDate='<%# Eval("begin_date","{0:d}") % >'


"Andre" <> a écrit dans le message de news:
...
> Hi,
>
> I need some help with an UpdateCommand syntax.
>
> Everything is ok with the major part of my update (if i don't use my
> calendar).
> For the Date field i use a Calendar, and i can't find a way to update
> my DB with the new date.
>
> Did someone have any answer or a palce where i can get some information
> on this ?
>
> Heres's my code :
>
> [...]
> <asp:TemplateField HeaderText="Begin_Date">
> <EditItemTemplate>
> <asp:Calendar ID="Calendar1" runat="server" SelectedDate='<%#
> Bind("begin_date") %>' VisibleDate='<%# Bind("begin_date") %' />
> </EditItemTemplate>
> <ItemTemplate>
> <asp:Label ID="Label1" runat="server" Text='<%# Eval("begin_date",
> "{0:d}") %>'></asp:Label>
> </ItemTemplate>
> </asp:TemplateField>
> [...]
> <asp:SqlDataSource id="sqlDetail" runat=server
> ConnectionString="<%$ConnectionStrings:SysAnnonces ConnectionString %>"
> SelectCommand="SELECT * FROM Adds WHERE NoAuto=@noAuto"
> UpdateCommand="UPDATE Adds SET Name = @Name, begin_date =
> @calendar1.selecteddate WHERE noAuto = @NoAuto">
> </asp:SqlDataSource>
> [...]
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
UpdateCommand DetailsView rote ASP .Net 1 11-23-2007 10:32 AM
DetailsView - Changing to Insert Mode (Not By Using the Insert Button In the DetailsView Control) Feege ASP .Net Web Controls 0 12-20-2005 12:28 AM
DataGrid1 UpdateCommand calling DataGrid2 UpdateCommand srathin ASP .Net Web Controls 2 04-10-2005 11:07 PM
DataGrid1 UpdateCommand calling DataGrid2 UpdateCommand srathin ASP .Net Datagrid Control 0 04-09-2005 03:05 AM
UpdateCommand with Datalist Mark ASP .Net 2 07-17-2003 08:51 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57