PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

how to change the datatype to a column with data

 
 
SIS01
Guest
Posts: n/a
 
      8th Sep 2010
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.


 
Reply With Quote
 
 
 
 
Cor
Guest
Posts: n/a
 
      8th Sep 2010
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 news:i68fed$40g$(E-Mail Removed)...

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.

 
Reply With Quote
 
SIS01
Guest
Posts: n/a
 
      8th Sep 2010
Ok, thanks its a workaround

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




"Cor" <(E-Mail Removed)> escribió en el mensaje
news:4c87c708$0$14115$(E-Mail Removed)...
> 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 news:i68fed$40g$(E-Mail Removed)...
>
> 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.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: Cannot change DataType of a column once it has data Matt Fielder Microsoft ADO .NET 4 9th Oct 2006 02:46 AM
Cannot change DataType of a column once it has data. ad Microsoft C# .NET 1 23rd Aug 2005 03:15 AM
[Datable] change column datatype Sam Microsoft VB .NET 6 14th Apr 2005 01:06 PM
change the datatype of an existing column of a table in sqlce database =?Utf-8?B?R29wYWwgSGFsZGFy?= Microsoft Dot NET Compact Framework 1 2nd Jun 2004 07:41 AM
How to change datatype column Eusebio M Microsoft Access 1 3rd Oct 2003 03:23 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:34 AM.