Larry Brister
asked on
Copy datatable into new datatable and rename columns
I have a datatable with the following columns
[start Date]
[Pmt Amount]
[Compounding]
How do I copy 2 of those columns into a new datatable to pass to SQL 2008 as a structured data table
the new datatable would be
startDate
PaymentAmt
[start Date]
[Pmt Amount]
[Compounding]
How do I copy 2 of those columns into a new datatable to pass to SQL 2008 as a structured data table
the new datatable would be
startDate
PaymentAmt
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
You put me on the right track...thanks
Dim dt As New DataTable
dt = ConvertTo(l_lead.Payments)
dt.Columns(0).ColumnName = "LeadType"
blah...blah...blah..
dt.Columns.Remove("LeadTyp e")
dt.Columns.Remove("Payment StreamID")
blah...blah...blah..
dt.Columns("EventType").Se tOrdinal(0 )
dt.Columns("StartDate").Se tOrdinal(1 )
dt.Columns("PmtAmount").Se tOrdinal(2 )
blah...blah...blah.."
Dim dt As New DataTable
dt = ConvertTo(l_lead.Payments)
dt.Columns(0).ColumnName = "LeadType"
blah...blah...blah..
dt.Columns.Remove("LeadTyp
dt.Columns.Remove("Payment
blah...blah...blah..
dt.Columns("EventType").Se
dt.Columns("StartDate").Se
dt.Columns("PmtAmount").Se
blah...blah...blah.."
by sample : where says row(ccor) -> row(ccor(n))