Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > How can I create a YES/NO column?

Reply
Thread Tools

How can I create a YES/NO column?

 
 
michaaal
Guest
Posts: n/a
 
      07-04-2004
I use this code to dynamically create a column in a table...

strSQL = "CREATE TABLE (FirstName TEXT(30), LastName TEXT(20));"
conn.execute(strSQL)


This will create two text columns. How can I create some YES/NO columns
instead of TEXT columns?


 
Reply With Quote
 
 
 
 
Rob Meade
Guest
Posts: n/a
 
      07-05-2004
"michaaal" wrote ...

> I use this code to dynamically create a column in a table...
>
> strSQL = "CREATE TABLE (FirstName TEXT(30), LastName TEXT(20));"
> conn.execute(strSQL)
>
>
> This will create two text columns. How can I create some YES/NO columns
> instead of TEXT columns?


You haven't mentioned what type of database you are using (Access/SQL Server
etc), however, you could always add a 'bit' or 'char' datatype and give it a
size of 1, then all 1's might be Yes and 0's might be No - you could handle
this within the app.

Regards

Rob


 
Reply With Quote
 
 
 
 
Aaron [SQL Server MVP]
Guest
Posts: n/a
 
      07-05-2004
> etc), however, you could always add a 'bit' or 'char' datatype and give it
> a
> size of 1, then all 1's might be Yes and 0's might be No


And if it's char(1), may as well be 'Y'/'N' or 'T'/'F' ...


 
Reply With Quote
 
Rob Meade
Guest
Posts: n/a
 
      07-05-2004
"Aaron [SQL Server MVP]" wrote ...

> And if it's char(1), may as well be 'Y'/'N' or 'T'/'F' ...


aye, I should have mentioned that....thanks for the pick-up Aaron ;o)

Regards

Rob


 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Create Api to create document and add,edit,delete text and t Krithika San Ruby 3 11-14-2009 09:29 PM
How can i create new users without utilizing the create user wizar prady ASP .Net 2 12-29-2007 10:46 PM
Can I create a Create .NET 1.1 project in VS2005? JB ASP .Net 1 12-14-2007 10:53 AM
How to create python script which can create csv we file with relationship Sonu Python 1 08-03-2007 01:08 PM



Advertisments