datagrid update with stored procedure

datagrid update with stored procedure

Post by Shannon Ra » Wed, 03 Dec 2003 22:45:22

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()
With Me.grdListRequestWorkOff
.DataSource = Me.dsListRequestWorkOff
.DataKeyField = "intTblRequestId"
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
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
End If
End Sub

in the page load.

Thanks for the help

datagrid update with stored procedure

Post by Shannon Ra » Wed, 03 Dec 2003 23:52:10

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
On Tue, 02 Dec 2003 07:45:22 -0600, Shannon Ramirez