How to add checkbox column in database dynamically

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • krishnaneeraja
    New Member
    • Mar 2008
    • 21

    How to add checkbox column in database dynamically

    Hi
    Iam developing c#.net windows application.In that i want to add some tables programatically .I want to add one table like num integer,name char(50),status yes/no,but i want status field is checkbox.How to add that display control programatically .plz help me.



    Thanks & Regards.
    Neeraja.
  • jeffstl
    Recognized Expert Contributor
    • Feb 2008
    • 432

    #2
    Originally posted by krishnaneeraja
    Hi
    Iam developing c#.net windows application.In that i want to add some tables programatically .I want to add one table like num integer,name char(50),status yes/no,but i want status field is checkbox.How to add that display control programatically .plz help me.



    Thanks & Regards.
    Neeraja.
    You must execute SQL on your database using CREATE TABLE and ALTER TABLE syntax for this.

    Code:
    CREATE TABLE table_name
    (
    column_name1 data_type,
    column_name2 data_type,
    .......
    )
    
    ALTER TABLE table_name 
    ADD column_name datatype

    Comment

    Working...