I thought perhaps the column had to be a type of date, then i ran into other problem
when trying to change the column type and import the data
Code:
If table1Success = True Then
'// Table1
UPRNjobs = UPRNjobs_C1.Clone
UPRNjobs.Tables(2).Columns("DateReceived").DataType = GetType(Date)
For Each dr As DataRow In UPRNjobs_C1.Tables(2).Rows
UPRNjobs.Tables(2).ImportRow(dr)
Next
If table2success = True Then
'// Combine both tables
For Each dr As DataRow In UPRNjobs_C2.Tables(2).Rows
UPRNjobs.Tables(2).ImportRow(dr)
Next
End If
Else
If table2success = True Then
'// Table 2 only
UPRNjobs = UPRNjobs_C2.Clone
UPRNjobs.Tables(2).Columns("DateReceived").DataType = GetType(Date)
For Each dr As DataRow In UPRNjobs_C2.Tables(2).Rows
UPRNjobs.Tables(2).ImportRow(dr)
Next
End If
End If
I get this message
ForeignKeyConstraint Data_Row requires the child key values (0) to exist in the parent table.