|
-
Dec 11th, 2008, 12:25 AM
#4
Re: Add New Column to Database by using codes
Adding new columns to your database tables doesn't magically change anything about your TableAdapters. The TableAdapters were created during development based on the schema of the database you were connected to at that time. They are classes that are compiled into your application.
If you want to be able to change the database schema at run time and have that reflected in your application then you can't use a typed DataSet. You're going to have to use an untyped DataSet and DataAdapters insteda of TableAdapters. That way the DataTable schema can be created at run time instead of pre-ordained at design time.
That said, adding columns to a database is something that you should never do lightly. It's a major change that is usually accompanied by a recompilation of the application because a different data schema almost always means different logic.
You should explain to us what this column represents and why you're adding it because I think it's 99% certain that your database structure is quite wrong and you shouldn't be adding a column at all.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|