I'm not sure what kind of detail is needed.. I create a new table on the SQL server, using Enterprise Manager. Then I go to VB .net, design the form, write all the code, and realize I need to make changes to the original table (such as adding a column, or changing properties). I close VB, go to the Enterprise Manager, and make the changes I need. Then I return to VB, and go to view data sources. I then right click to refresh the data sources and the changes I made in Enterprise Manager do not show up.
No, they wont, because the contents of the Data Sources window are derived from the schema of one or more DataSet objects in your project. If your project has no DataSet, your data sources has no entries. If your project has five DataSets your data sources have five entries. DataSet is the client side temporary storage container for data downlaoded from a database. There is no mandate that it must be identical in structure to the database schema for which it serves, ergo it is allowed that a database table has columns that are not present in your data set
Go into the dataset designer and reconfigure all necessary datatables and/or tableadapters to use the new database columns
I want to know if there is a way to avoid this, and simply have the table refresh. Hope that makes sense...
When you make a tableadapter/datatable pair, the tableadapter wizard asks you for an SQL to use to derive the main structure. You probably wrote:
SELECT * FROM emp
Because the wizard cannot be doing with something as vague as *, it reads the schema for the table and converts your query to:
SELECT name, dept, salary, manager FROM emp
Now it can make a datatable of 4 columns, map these columns to the database and it will al always work unless you use the enterprise manager to rip out one of these columns or change the primary key. Add columns to the DB all you want, and the tableadapter wont care
If you want to use your new column, configure the tableadapter with a NEW query. Right click it and choose configure.. Add in the relevant column and the wizard should generate you a new datatable. It may then also ask you:
"You have changed the SELECT command, do you want to update the existing INSERT/UPDATE/DELETE commands based on the new query text?" or soemthing like that.. You can say yes if:
You have not customised them and are worried about your changes being lost
and
You need to send changes to the new column back to the database.
If you need neither of these, you can say no to this question