I found a work around. What it was is that if the second table is
missing some datacolumns based on the first table, I want it to add the
missing data columns in, using all formatting data from the first table.
I ended up working on a PRoperty walker that created the new
datacolumn, and copied attributes (shallow copy) of the datacolumn I
wanted to add to the second table.
Thanks,
Cade
Kathleen Dollard wrote:
> Cade,
>
> I think I am missing something.
>
> It looks like you are trying to get .NET to infer a mapping when there is no
> mapping information. Are hte names of the columsn in the second table the
> same (then it would be dt.Rows(thisrow)(columnName).
>
> Kathleen
>
>
> "Cade Carvell" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>>Hello,
>> I am trying to copy a datacolumn from a good table, and append it to
>>an incoming table that needs to be modified. This incoming table has
>>data, and I would rather not copy each property one by one, Is thier a
>>way to get the propertyinfo stuff to work were I can read the property
>>of a datacolumn, and set it on a new datacolumn...Here is were I am at
>>in Code:
>>If Not (TBL.Columns.Contains(DC.ColumnName)) Then
>> Dim DCNEW As New DataColumn
>> Dim T As Type
>> T = DC.GetType
>> Dim Pi As System.Reflection.PropertyInfo
>> For Each Pi In
>>T.GetProperties(System.Reflection.BindingFlags.Public Or
>>System.Reflection.BindingFlags.Instance)
>> Dim result As Object
>> If Pi.CanWrite Then
>> Try
>> result = Pi.GetValue(DC,
>>System.Reflection.BindingFlags.Public Or
>>Reflection.BindingFlags.Instance Or Reflection.BindingFlags.GetProperty,
>>Nothing, Nothing, Nothing)
>> '********Now that I havge the result, how do I get it
>>back into the new datacolumn?
>> Catch
>> Debug.WriteLine(Pi.Name & " = " & "Can't get Value")
>> End Try
>> End If
>> Next
>> TBL.Columns.Add(DC)
>>End If
>>
>>Thanks to anyone who can help me with this.
>>
>>Cade
>>
>
>
>
|