how to change the datatype to a column with data

  • Thread starter Thread starter SIS01
  • Start date Start date
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.
 
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.
 
Ok, thanks its a workaround

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