?
Solved

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

Posted on 2004-11-08
2
Medium Priority
?
203 Views
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
else
 mydataset.mytable(i)(MyBoolean) = False
next i

can i change this type from string to boolean somehow?
0
Comment
Question by:jxharding
  • 2
2 Comments
 
LVL 25

Expert Comment

by:RonaldBiemans
ID: 12521538
Hi Jxharding,

Have you tried

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

Accepted Solution

by:
RonaldBiemans earned 120 total points
ID: 12521547
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
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month13 days, 16 hours left to enroll

807 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