can i change a filled dataset's column from type string to boolean?

Posted on 2004-11-08
Last Modified: 2010-04-23
hi,a field in my database is not boolean and i cant change it.
instead, it is filled with Y or N values.
now what i need to do is fill MyDataset from a dataadapter.
no problem
but now the MyBoolean field of  MyDataset is of type string
now i say
for i = 0 to MyDataset.MyTable.Count -1
if mydataset.mytable(i)(MyBoolean) = Y then
 mydataset.mytable(i)(MyBoolean) = True
 mydataset.mytable(i)(MyBoolean) = False
next i

can i change this type from string to boolean somehow?
Question by:jxharding
    LVL 25

    Expert Comment

    Hi Jxharding,

    Have you tried

            mydataset.mytable(i)(myboolean).DataType = GetType(System.Boolean)
    LVL 25

    Accepted Solution

    Sorry forget my previous comment, You cannot change the datatype of a column once it contains data,
    So the only thing you can is add an booelan extra column, and fill it with the data from myboolean

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    I'm currently working for a company where I have to upgrade over 50 VB6 programs to VB.NET 2008.  So far I'm about half way through, and I've learned quite a few tricks that drastically improve the performance of VB.NET apps. Because there are a…
    Article by: jpaulino
    XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String ( Literal, only instead of starting and ending with w…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    This video discusses moving either the default database or any database to a new volume.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now