"David" <>'s wild thoughts were
released on Fri, 23 Jun 2006 17:15:46 -0500 bearing the
following fruit:
>I am getting "Object reference not set to an instance of an object."
>when I try to set the value of a string variable in a OnDelete method of sql
>command subroutine. Can anyone help with the syntax? Below is code:
You'll find slectedrow isn't set on a delete, if you want to
know which row invoked the delete use e.RowIndex
J
>Sub On_Subfile_Deleting(ByVal source As Object, ByVal e As
>SqlDataSourceCommandEventArgs)
>
>'Set value of new Subfile text from cell
>
>'Subfile text is contained in the 3rd column (index 2).
>
>Dim strsubfile As String = SubfilesGridView.SelectedRow.Cells(2).ToString()
>
>
>'Set value of new SeqNo from cell
>
>'SeqNo is contained in the 2nd column (index 1).
>
>Dim strseqno As String = SubfilesGridView.SelectedRow.Cells(1).ToString()
>
>
>'Run function in DBClass module to delete network subfile folder
>
>LblMsg.Text = DBClass.DeleteSubfolders(strseqno, strsubfile,
>CLng(txtFileNumber.Text))
>
>LblMsg.Visible = True
>
>
>End Sub 'On_Subfile_Updating
>
>Thank you.
>
>David
>
Jan Hyde (VB MVP)
--
A pessimist's blood type is always b-negative. (Pun of the Day)
|