Results 1 to 16 of 16

Thread: [RESOLVED] Gridview update from stored procedure

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    134

    Resolved [RESOLVED] Gridview update from stored procedure

    How do you programatically update a row in a gridview using a stored procedure.

    Code:
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
    For Each row As GridViewRow In Me.assignmentGridView.Rows
                Me.assignmentDataSource.Update()
                'where the update uses the parameters are defined below in .aspx file
            Next
    EndSub
    the above code does not do anything, but its the idea of what Im trying to do.

    Code:
    <asp:SqlDataSource ID="assignmentDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:FCRscheduleConnectionString %>"
                SelectCommand="dayAssignment" SelectCommandType="StoredProcedure" UpdateCommand="dayAssignmentUpdate" UpdateCommandType="StoredProcedure">
                <SelectParameters>
                    <asp:ControlParameter ControlID="Calendar1" Name="date" PropertyName="SelectedDate"
                        Type="DateTime" />
                </SelectParameters>
                <UpdateParameters>
                    <asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
                    <asp:ControlParameter ControlID="Calendar1" Name="date" PropertyName="SelectedDate"
                        Type="DateTime" />
                    <asp:ControlParameter ControlID="assignmentGridView" Name="fcrID" PropertyName="SelectedValue"
                        Type="Int32" />
                    <asp:ControlParameter ControlID="assignmentGridView" Name="Site" PropertyName="SelectedValue"
                        Type="Int32" />
                </UpdateParameters>
            </asp:SqlDataSource>
    Last edited by Samir Nagheenanajar; Aug 6th, 2009 at 04:49 PM. Reason: make more clear
    censored

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width