Parent Columns and Child Columns don't have type-matching columns

Parent Columns and Child Columns don't have type-matching columns

Post by microsoft » Fri, 17 Sep 2004 18:40:36

i have a windows app project which is independent of the database, i.e. just
by changing the values in the config file i can connect to any kind of
database through any provider.
I have no problems when connecting to Oracle using the System.Oracle however
when i try to connect to Oracle using ODP, in one particular scenario it
gives the following error
"Parent Columns and Child Columns don't have type-matching columns". this
occurs when i try to add a relation to two tables within a dataset
I have no clue why this happens only in case of ODP and not in case of
The code has been given below:
Friend Shared Function Load(ByVal bpoID As Int32) As DataSet
Dim ds As DataSet
Dim spParams(10) As Object
Dim tableNames(9) As String
Dim provider As FrameworkBuilderDataProvider
spParams(0) = bpoID
tableNames(0) = consTblBpo
tableNames(1) = consTblClassAttrib
tableNames(2) = consTblClassAttriblist
tableNames(3) = consTblClassAttriblistArgs
tableNames(4) = consTblClassImplements
tableNames(5) = consTblBpoMethod
tableNames(6) = consTblMethAttrib
tableNames(7) = consTblMethAttriblist
tableNames(8) = consTblMethAttriblistArg
tableNames(9) = consTblMethodImplements
provider = FrameworkBuilderDataProvider.GetInstance("")
ds = provider.ExecuteDataSet(consSpGetBpoBpoMethodFilter,
spParams, tableNames, consStrApplicationIdentifier)
Dim rel As DataRelation
Dim relBPO As String = "R_BPO"
Dim dsName As String = "DCs"
Dim colParent As DataColumn
Dim colChild As DataColumn
colParent = ds.Tables(consTblBpo).Columns(consColBPOID)
colChild = ds.Tables(consTblBpoMethod).Columns(consColBPOID)
ds.Relations.Add(relBPO, colParent, colChild) ---(fails
by giving error Parent Columns and Child Columns don't have type-matching
Return ds
Catch Ex As Exception
Throw New FWBuilderException(Ex.Message, Ex)
If Not ds Is Nothing Then
End If
provider = Nothing
End Try
End Function
The above mentioned method call fails because the colParent is having
DataType as "Decimal" while the colChild is having dataType as "Int64(Long)"
, while we have checked in the database that both datatype of both the
columns are same.
Also such problem exist only with this method, there are so many methods
where we create the Relation in dataset but the same is not failing as the
datatype returned by ExecuteDataSet is same for both the columns.
Can someone please help me

Pooja Renukdas

Parent Columns and Child Columns don't have type-matching columns

Post by rami.saa » Wed, 22 Sep 2004 18:08:16


have you tried explicit casting of one of the variables?
I had this problem before, and it was solved using casting.
Can you try this method and let me know if the problem is still not solved?

Rami Saad
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC