how to change the datatype to a column with data

S

SIS01

Hi, all

I read a text file into a generic Dataset,

I need to change one of the columns datatype from String to decimal (money).

mds.Tables(0).Columns("IMPORTE").DataType = GetType(Decimal)
But i get an error like "Cant change datatype to a column with data".

I've tried to copy to a TypedDataset but i get errors too:

dsty.dttable.Merge(mds.Tables(0))


Any suggestion please.

Thanks in advance.
 
C

Cor

Create an extra column with an expression,

Full description for generated dataset below
http://msdn.microsoft.com/en-us/library/3df0c8ey(v=VS.100).aspx


"SIS01" wrote in message
Hi, all

I read a text file into a generic Dataset,

I need to change one of the columns datatype from String to decimal (money).

mds.Tables(0).Columns("IMPORTE").DataType = GetType(Decimal)
But i get an error like "Cant change datatype to a column with data".

I've tried to copy to a TypedDataset but i get errors too:

dsty.dttable.Merge(mds.Tables(0))


Any suggestion please.

Thanks in advance.
 
S

SIS01

Ok, thanks its a workaround

But
I insist, is there another way or is impossible to change datatype a
datacolumn with data ?
 

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