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

Started by
1 comment, last by drummer1549 17 years, 8 months ago
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.
Going to Iraq without France is like going deer hunting without your accordion.
Advertisement
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.
It worked perfectly thanks for your help!
Going to Iraq without France is like going deer hunting without your accordion.

This topic is closed to new replies.

Advertisement