I have a DataTable.
How can I change the the type of one column from bool to int ?

Re: How to change the column type? by Cowboy

Cowboy
Tue Oct 03 15:31:40 CDT 2006

In the designer, you can click on the column in question and then go to the
Properties window and set there.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*************************************************
Think outside of the box!
*************************************************
"ad" <flying@wfes.tcc.edu.tw> wrote in message
news:OLIYxny5GHA.4864@TK2MSFTNGP06.phx.gbl...
>I have a DataTable.
> How can I change the the type of one column from bool to int ?
>



Re: How to change the column type? by ad

ad
Wed Oct 04 16:38:30 CDT 2006

But I want to change it in run time.
How can I do?

"Cowboy (Gregory A. Beamer)" <NoSpamMgbworld@comcast.netNoSpamM> ¼¶¼g©ó¶l¥ó·s»D:emI%23qry5GHA.668@TK2MSFTNGP02.phx.gbl...
> In the designer, you can click on the column in question and then go to
> the Properties window and set there.
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
> http://gregorybeamer.spaces.live.com
>
> *************************************************
> Think outside of the box!
> *************************************************
> "ad" <flying@wfes.tcc.edu.tw> wrote in message
> news:OLIYxny5GHA.4864@TK2MSFTNGP06.phx.gbl...
>>I have a DataTable.
>> How can I change the the type of one column from bool to int ?
>>
>
>



Re: How to change the column type? by William

William
Wed Oct 04 18:22:57 CDT 2006

Ah, behind the scenes, the tools usually execute an ALTER TABLE command if
the backend supports it. You can do the same. However, I'm troubled with the
wisdom of doing so.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
Between now and Nov. 6th 2006 you can sign up for a substantial discount.
Look for the "Early Bird" discount checkbox on the registration form...

"ad" <flying@wfes.tcc.edu.tw> wrote in message
news:uNxg01$5GHA.4708@TK2MSFTNGP05.phx.gbl...
> But I want to change it in run time.
> How can I do?
>
> "Cowboy (Gregory A. Beamer)" <NoSpamMgbworld@comcast.netNoSpamM>
> ¼¶¼g©ó¶l¥ó·s»D:emI%23qry5GHA.668@TK2MSFTNGP02.phx.gbl...
>> In the designer, you can click on the column in question and then go to
>> the Properties window and set there.
>>
>> --
>> Gregory A. Beamer
>> MVP; MCP: +I, SE, SD, DBA
>> http://gregorybeamer.spaces.live.com
>>
>> *************************************************
>> Think outside of the box!
>> *************************************************
>> "ad" <flying@wfes.tcc.edu.tw> wrote in message
>> news:OLIYxny5GHA.4864@TK2MSFTNGP06.phx.gbl...
>>>I have a DataTable.
>>> How can I change the the type of one column from bool to int ?
>>>
>>
>>
>
>



RE: How to change the column type? by LouArnold

LouArnold
Wed Oct 04 20:30:02 CDT 2006

Well, one way of finding out is to write some code and set a breakpoint where
the DataTable has the columns defined and some data in the rows. You should
then look at the Row collection. The row objects contain the actual data, not
the column objects.

One Row object component will be the "DataType" property. This is your
target for investigation in the documentation about Row objects. Your goal is
to write code to change that a property that will change that DataType
property. You may not be able to do it directly, but you should look up
ennumerated types for System::DataType.