Data in modified dataset will not show up in datagrid.
Hi,
I have a problem with the following scenario.
I am sending in a dataset into a function where I delete certain rows,
I am deleting the data through a DataView which deletes from the
Dataset.datatable. When I try to display the dataset in a datagrid
after having modified it only the headers will show up. I know there
is data in the dataset, it shows up in the command window. I would
very much appreciate any ideas, thanks!! Mia
Here is the code for the function
Public Function DeleteOrderDetail(ByVal vCrit As ArrayList, ByRef
dsData As DataSet, ByRef iCartItems As Integer)
Dim iRet As Integer
Dim sErr As String
Dim iLoop As Integer
Dim iNum As Integer
Dim oSW As StreamWriter
Dim dvStyle As New DataView
Dim dvSize As New DataView
iRet = CI_FAILURE
Try
dvStyle.AllowDelete = True
dvSize.AllowDelete = True
dvStyle = dsData.Tables(1).DefaultView
dvSize = dsData.Tables(2).DefaultView
dvStyle.RowFilter = dsData.Tables(1).Columns(2).ColumnName
& "='" & _
vCrit(0).ToString & "'"
iNum = dvStyle.Count - 1
While iNum >= 0
dvSize.RowFilter =
dsData.Tables(2).Columns(1).ColumnName & "='" & _
dvStyle(iNum).Item(0).ToString
& "'"
iLoop = dvSize.Count - 1
While iLoop >= 0
dvSize(iNum).Row.Delete()
iLoop -= 1
End While
dvStyle(iNum).Row.Delete()
iNum -= 1
End While
iRet = CI_SUCCESS
Catch ex As
Exception
iRet =
CI_FAILURE_CATCH
sErr = "fnWholesale.DeleteOrderDetail, " & DateTime.Now &
", " & ex.ToString _
& ", " &
ex.Message
oSW = New
StreamWriter(System.AppDomain.CurrentDomain.BaseDirectory.ToString _
& CS_WHLSE_LOG,
True)
oSW.WriteLine(sErr)
oSW.Close()
Finally
oSW =
Nothing
End
Try
Return
iRet
End Function
Date:Wed, 08 Aug 2007 12:44:57 -0000
Author:
|