Jump to content
  • Advertisement
Sign in to follow this  
drummer1549

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

This topic is 4355 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!