Copy Column1 from dt1 to dt2


#1

Hello,

I apologize if this is a duplicate, this is probably very easy.

I have dt1 which contains 20 columns and dt2 which is an empty DataTable. I only want column index 1 to be copied to dt2.

In other words, I’m trying to isolate a single column from one data table into a new one.

Thanks in advance for your help.

Will


#2

@will.hankins
dt2=dt1.DefaultView.ToTable(False,“Column1 NAme”)

Regards,
Mahesh


#3

Thanks. That worked.

One other question. I’ve seen you responding to other threads and you seem to know VB.Net quite well. Is there some reference website I can go to more quickly find VB.Net code to solve my own problems? Any other tips or advice you have on improving proficiency in VB.Net?

Thanks,

Will


#4

@will.hankins

1.Go through the basics of vb.net.
2.Go through the forum posts.

Helps you to learn.

Regards,
Mahesh