Changing datatype of a column in a datatable

G

Griff

When attempting to change the datatype for a datatable column with the
following code:

dtap.Columns(4).DataType = system.Type.GetType"System.String")

I keep getting an error that says that I can't change the datatype
because there is data in the table. However, I know there is no data in
the table, as I have cleared the table and tested the results.

Please help.

Thanks
 
C

Cor Ligthert

Griff,

Why not just add a column and remove a column than in this case?

I would not search to long in your situation.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top