Sign in to follow this  
drummer1549

[.net] Adding a column to an Access database in c#

Recommended Posts

Hello. Im sending out an update for some software ive been developing and the update needs a new column added to an access database on the user's computer. Im not real good with access databases yet so i cant figure out how to do this. Ive tried making a new column then using dataset.datatable.Columns.Add(columnName); but when i call the update method and check the database it did not update the .mdb file. Can someone give me a small code snippet to show how this is correctly done? Thanks for your help.

Share this post


Link to post
Share on other sites
Have you tried just doing an alter table query? just do a query like:

ALTER TABLE tablename ADD COLUMN new_column TEXT(25);

using the same function you would use to do a select query.

Greetings.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this