J
jp2msft
I need to create a data relation between two rows in two tables that were
designed poorly years ago. TableA has the ID Number Column as a varchar(50)
array, whereas TableB has the ID Number Column as an integer.
The tables are in production and have several other applications that rely
on them, so they can not simply be changed.
The code below does not work because they two columns are incompatible:
Can a DataRelation be be created with these two columns?
designed poorly years ago. TableA has the ID Number Column as a varchar(50)
array, whereas TableB has the ID Number Column as an integer.
The tables are in production and have several other applications that rely
on them, so they can not simply be changed.
The code below does not work because they two columns are incompatible:
Code:
// ID_Num is type nvarchar(50)
DataColumn dcParent
= m_dataSet.Tables[m_strTableA].Columns["ID_Num"];
// IDNUM is type int
DataColumn dcChild
= m_dataSet.Tables[m_strTableB].Columns["IDNUM"];
DataRelation dr
= new DataRelation("AtoB", dcParent, dcChild);
m_dataSet.Relations.Add(dr);
Can a DataRelation be be created with these two columns?