How to set a DataTable Column DataType to boolean

K

keithb

The following code sets a DataTable column DataType to "String"

column.DataType = System.Type.GetType("System.String");

What is the corresponding statement when the data type is boolean? I have
tried both "bit', "bool", and "boolean" and all cause an error.

One would think that a simple search for "System.Type.GetType" in Books On
Line would yield an answer but all I get is page after page after page of
loosely unrelated information.

Thanks,

Keith
 
Joined
Jul 29, 2010
Messages
1
Reaction score
0
Renato Cunha (Brazil)

This is the code

column.DataType = System.Type.GetType("System.Boolean");

You can type System. without quote, and find the keyword 'Boolean', after you chose you can type the quotes ("")

Sorry my bad english because I´m brazilian and here speak in portuguese.

Kisses


MSDN said:
You might have done this already.
what about "Boolean" with a capital B

SA

"keithb" <[email protected]> wrote in message
news:OMXm9%[email protected]...
> The following code sets a DataTable column DataType to "String"
>
> column.DataType = System.Type.GetType("System.String");
>
> What is the corresponding statement when the data type is boolean? I have
> tried both "bit', "bool", and "boolean" and all cause an error.
>
> One would think that a simple search for "System.Type.GetType" in Books On
> Line would yield an answer but all I get is page after page after page of
> loosely unrelated information.
>
> Thanks,
>
> Keith
>
>
>
>
>
>
 

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

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top