borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Icon in tree view)Next Topic (hwnd of my program) New Topic New Poll Post Reply
AndreaVB Forum : VB.Net : add column in database dynamically Solved Topic
Poster Message
tanmoy
Level: Whizz Kid

Registered: 17-03-2006
Posts: 18

icon add column in database dynamically

hello sir.i have a table name "trans".i want to add column in this table dynamicaly and also remove column dynamically.the column name will be given by d user.and i also tell the column number.suppose in my "trans" table there are three columns.the column names are "cake","pastry","totalquan".now i want to add a column name biscuit after the pastry column.how can i do this? this is my problem.please help me.my programe is write in vb.net and my database is in ms.access.help me please.

____________________________
ambarish sadhu

17-03-2006 at 08:26 PM
View Profile Send Email to User Show All Posts | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: add column in database dynamically

YOu can use SQL to add column to existing table, using ALTER TABLE and ADD COLUMN keywords.

ALTER TABLE table_name ADD column_name datatype


As for the "inserting column", you dont need to insert in in a particular place. You can insert it in the end, and when you fetch data from table, in SELECT statement you will set the order of the columns to be shown.

____________________________
If you find the answer helpful, please mark this topic as solved.

20-03-2006 at 01:07 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB.Net : add column in database dynamically Solved Topic
Previous Topic (Icon in tree view)Next Topic (hwnd of my program) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder