datagrid update with stored procedure

Ask a Question related to ASP.NET Data Grid Control, Design and Development.

  1. #1

    Default datagrid update with stored procedure

    I'm using a join statement
    in a stored procedure and passing in info to the stored procedure. I
    have a unique key value that comes back in the result set.. but I
    can't get the edit to work.

    Here is a small snibit.
    intTblInstitutionId, vcInstitutionName, LastName, email

    Sub bindgrid()
    Me.daListRequestWorkOff.Fill(Me.dsListRequestWorkO ff)
    With Me.grdListRequestWorkOff
    .DataSource = Me.dsListRequestWorkOff
    .DataKeyField = "intTblRequestId"
    .DataBind()
    End With
    End Sub
    Private Sub grdListRequestWorkOff_EditCommand(ByVal source As
    Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs )
    Handles grdListRequestWorkOff.EditCommand
    Me.grdListRequestWorkOff.EditItemIndex = e.Item.ItemIndex
    bindgrid()
    End Sub

    When I open the page, I choose some values from a drop down list that
    fills in the info I need to pass the stored procedure. those items
    populate a datagrid. when I click on edit, all the data goes away and
    I only see the column heading with no data. What have I done wrong.
    I have

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles MyBase.Load
    'Put user code to initialize the page here
    If Not Page.IsPostBack Then
    bindgrid()
    End If
    End Sub

    in the page load.

    Thanks for the help
    Shannon Ramirez Guest

  2. Similar Questions and Discussions

    1. Using a stored procedure
      I am trying to pass a ProdID to a stored procedure, but I get an error: Error Executing Database Query. Procedure 'PriceBreak' expects...
    2. date field in update stored procedure
      When I try to update a date field that I've previously added to a SQL Server table, I get ths error message: Error converting data type varchar to...
    3. Populate Datagrid from a Stored Procedure
      I am trying to fill datagrid from a stored procedure using the following code: Public Sub dgTicketsFill2() I have removed a of my connString...
    4. populate datagrid with stored procedure w/parameter
      All, I'm trying to populate a datagrid with a data adapter that uses a stored procedure with a parameter. I get the below error when I run my...
    5. Stored procedure from stored procedure
      Is it possible to create a stored procedure from a stored procedure? When I attempt this inanity, it doesn't blow up until syntax error at the...
  3. #2

    Default Re: datagrid update with stored procedure

    working on this some more... I have profiler fired up in sql server.
    when the datagrid gets populated, there are values being passed into
    the stored proceudre. When I click on edit, the edit event is fired,
    however, when the databind fires, the stored procedure is called
    again, but this time all the parameters are filled in with the value
    of default. How do I get the stored procedure to fire with the values
    I passed in the first time and still be able to use the edit event.

    any help would be great
    thanks
    shannon
    On Tue, 02 Dec 2003 07:45:22 -0600, Shannon Ramirez
    <ramirez@sauder.com> wrote:
    >I'm using a join statement
    >in a stored procedure and passing in info to the stored procedure. I
    >have a unique key value that comes back in the result set.. but I
    >can't get the edit to work.
    >
    >Here is a small snibit.
    >intTblInstitutionId, vcInstitutionName, LastName, email
    >
    > Sub bindgrid()
    > Me.daListRequestWorkOff.Fill(Me.dsListRequestWorkO ff)
    > With Me.grdListRequestWorkOff
    > .DataSource = Me.dsListRequestWorkOff
    > .DataKeyField = "intTblRequestId"
    > .DataBind()
    > End With
    > End Sub
    > Private Sub grdListRequestWorkOff_EditCommand(ByVal source As
    >Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs )
    >Handles grdListRequestWorkOff.EditCommand
    > Me.grdListRequestWorkOff.EditItemIndex = e.Item.ItemIndex
    > bindgrid()
    > End Sub
    >
    >When I open the page, I choose some values from a drop down list that
    >fills in the info I need to pass the stored procedure. those items
    >populate a datagrid. when I click on edit, all the data goes away and
    >I only see the column heading with no data. What have I done wrong.
    >I have
    >
    > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
    >System.EventArgs) Handles MyBase.Load
    > 'Put user code to initialize the page here
    > If Not Page.IsPostBack Then
    > bindgrid()
    > End If
    > End Sub
    >
    >in the page load.
    >
    >Thanks for the help
    Shannon Ramirez Guest

Posting Permissions

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

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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139