DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: DropDownList does not update

  1. #1
    Join Date
    Jun 2007
    Location
    Oregon
    Posts
    14

    Question DropDownList does not update

    When I try to change the drop down list to another item it does not update the database


    CODE Used
    <asp:GridView runat="server" id="gvDipStatusRack" AutoGenerateColumns="False" DataSourceID="SqlDipStatusRack" DataKeyNames="ID,MID,RACK,STATUS,SHIFT,SCHEDULEDDIPTIME,ACTUALDIPTIME"
    BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" ForeColor="Black" CellPadding="4" GridLines="Vertical">
    <FooterStyle BackColor="#CCCC99" />
    <Columns>
    <asp:commandfield ButtonType="Button" ShowEditButton="True">
    </asp:commandfield>
    <asp:boundfield ReadOnly="True" DataField="ID" InsertVisible="False" Visible="False" SortExpression="ID" HeaderText="ID">
    </asp:boundfield>
    <asp:boundfield ReadOnly="True" DataField="MID" Visible="False" SortExpression="MID" HeaderText="MID">
    </asp:boundfield>
    <asp:boundfield DataField="RACK" SortExpression="RACK" HeaderText="RACK">
    </asp:boundfield>
    <asp:templatefield SortExpression="STATUS" HeaderText="STATUS">
    <EditItemTemplate>
    <asp:DropDownList runat="server" id="ddlSTATUS" SelectedValue='<%# Bind("STATUS") %>'>
    <asp:ListItem>PENDING</asp:ListItem>
    <asp:ListItem>SKIPPED</asp:ListItem>
    <asp:ListItem>OVERRIDDEN</asp:ListItem>
    <asp:ListItem>COMPLETE</asp:ListItem>
    </asp:DropDownList>
    </EditItemTemplate>
    <ItemTemplate>
    <asp:Label Text='<%# Eval("STATUS") %>' runat="server" ID="IDLabelStatus" />
    </ItemTemplate>
    </asp:templatefield>
    <asp:boundfield ReadOnly="True" DataField="SHIFT" SortExpression="SHIFT" HeaderText="SHIFT">
    </asp:boundfield>
    <asp:boundfield ReadOnly="True" DataField="SCHEDULEDDIPTIME" SortExpression="SCHEDULEDDIPTIME" HeaderText="SCHEDULEDDIPTIME">
    </asp:boundfield>
    <asp:boundfield ReadOnly="True" DataField="ACTUALDIPTIME" SortExpression="ACTUALDIPTIME" HeaderText="ACTUALDIPTIME">
    </asp:boundfield>
    </Columns>
    <RowStyle BackColor="#F7F7DE" />
    <SelectedRowStyle BackColor="#CE5D5A" ForeColor="White" Font-Bold="True" />
    <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
    <HeaderStyle BackColor="#6B696B" ForeColor="White" Font-Bold="True" />
    <AlternatingRowStyle BackColor="White" />
    </asp:GridView>
    <asp:SqlDataSource runat="server" ID="SqlDipStatusRack" ConnectionString="<%$ ConnectionStrings:BasketReportConnectionString %>"
    SelectCommand="SELECT [ID], [MID], [RACK], [STATUS], [SHIFT], [SCHEDULEDDIPTIME], [ACTUALDIPTIME]
    FROM [DIPSTATUSTIMES]
    WHERE ([MID] = @MID)"
    DeleteCommand="DELETE
    FROM [DIPSTATUSTIMES]
    WHERE [ID] = @ID AND [MID] = @MID"
    InsertCommand="INSERT INTO [DIPSTATUSTIMES] ([ID], [MID], [RACK], [STATUS], [SHIFT], [SCHEDULEDDIPTIME], [ACTUALDIPTIME])
    VALUES (@ID, @MID, @RACK, @STATUS, @SHIFT, @SCHEDULEDDIPTIME, @ACTUALDIPTIME)"
    UpdateCommand="UPDATE [DIPSTATUSTIMES]
    SET [RACK] = @RACK, [STATUS] = @STATUS, [SHIFT] = @SHIFT, [SCHEDULEDDIPTIME] = @SCHEDULEDDIPTIME, [ACTUALDIPTIME] = @ACTUALDIPTIME
    WHERE [ID] = @ID AND [MID] = @MID">
    <DeleteParameters>
    <asp:parameter Type="Int32" Name="ID" />
    <asp:parameter Type="Int32" Name="MID" />
    </DeleteParameters>
    <UpdateParameters>
    <asp:parameter Type="String" Name="RACK" />
    <asp:parameter Type="String" Name="STATUS" />
    <asp:parameter Type="String" Name="SHIFT" />
    <asp:parameter Type="DateTime" Name="SCHEDULEDDIPTIME" />
    <asp:parameter Type="DateTime" Name="ACTUALDIPTIME" />
    <asp:parameter Type="Int32" Name="ID" />
    <asp:parameter Type="Int32" Name="MID" />
    </UpdateParameters>
    <SelectParameters>
    <asp:controlparameter PropertyName="SelectedValue" Type="Int32" Name="MID" ControlID="gvDipStatus" />
    </SelectParameters>
    <InsertParameters>
    <asp:parameter Type="Int32" Name="ID" />
    <asp:parameter Type="Int32" Name="MID" />
    <asp:parameter Type="String" Name="RACK" />
    <asp:parameter Type="String" Name="STATUS" />
    <asp:parameter Type="String" Name="SHIFT" />
    <asp:parameter Type="DateTime" Name="SCHEDULEDDIPTIME" />
    <asp:parameter Type="DateTime" Name="ACTUALDIPTIME" />
    </InsertParameters>
    </asp:SqlDataSource>
    Last edited by Mosser; 06-11-2007 at 12:28 PM.
    Thanks,

    MO

  2. #2
    Join Date
    Jun 2007
    Location
    Oregon
    Posts
    14

    --Fixed--

    Nevermind I fixed it.
    Thanks,

    MO

  3. #3
    Join Date
    Jun 2007
    Location
    San Francisco
    Posts
    2

    Post your solution

    I am having the same problem, how did you solve this?

    Thanks!

  4. #4
    Join Date
    Jun 2007
    Location
    Oregon
    Posts
    14
    I'll have to remember back and let ya know...

    R u getting any kind of error or is it just not updating?
    Also it needs some kinda commit (usually a update button/link) but I am assuming you have and are doing this.

    MO
    Thanks,

    MO

Similar Threads

  1. Replies: 2
    Last Post: 04-05-2006, 12:17 PM
  2. Replies: 0
    Last Post: 06-24-2003, 07:55 PM
  3. Replies: 0
    Last Post: 06-04-2002, 10:13 AM
  4. Replies: 0
    Last Post: 05-07-2002, 08:34 PM
  5. Urgent!!! ADO Update conflict
    By Chillu in forum VB Classic
    Replies: 0
    Last Post: 07-14-2000, 12:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center