ousoonerjoe
Programmer
I am trying to copy a DataRow from one DataTable to another. In standard MSDN Help File fashion, when duplicating what is depicted, it doesn't work.
The red line above returns the error:
'array' argument cannot be null.
Parameter name: array
What am i missing here? All i want to do is take the filtered result set from the DataView and add it to the CmbTab that will be bound to a combo box.
Any assistance is highly appreciated. Thank you.
--------------------------------------------------
Stubbornness is a virtue -- if you are right. --Chuck Noll
--------------------------------------------------
Code:
[COLOR=navy](MSDN Help File Syntax)
Dim instance As DataRowCollection
Dim array As DataRow()
Dim index As Integer
instance.CopyTo(array, index)[/color]
Code:
Private Sub dgTrunk_UserDeletedRow(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewRowEventArgs) Handles dgTrunk.UserDeletedRow
Dim Pop As clsSql = Nothing
Dim dView As DataView = Nothing
Dim dTab As DataTable = Nothing
Dim CmbTab As DataSet = Nothing
Dim dRow As DataRow()
CmbTab = cmbStages.DataSource
If Pop Is Nothing Then Pop = New clsSql
Pop.CommandString = "cst_Select_AsyLineStages"
Pop.AddParam("@AsyLineId", cmbAsyLine.SelectedValue)
dTab = Pop.OpenDataTable
dView = dTab.DefaultView
dView.RowFilter = "StageId = " & e.Row.Cells(0).Value
[COLOR=red]dView.Table.Rows.CopyTo(dRow, 0)[/color]
CmbTab = cmbStages.DataSource
CmbTab.Tables(0).Rows.Add(dRow(0))
cmbStages.DataSource = CmbTab
End Sub
'array' argument cannot be null.
Parameter name: array
What am i missing here? All i want to do is take the filtered result set from the DataView and add it to the CmbTab that will be bound to a combo box.
Any assistance is highly appreciated. Thank you.
--------------------------------------------------
Stubbornness is a virtue -- if you are right. --Chuck Noll
--------------------------------------------------