Perhaps I wasn't clear in asking my question Kevin:
Your reply below will refresh the table, but only the data, not the schema.
I went to Advanced Options Dialog Box as you suggested and the Refresh the
data table option says it "Adds a Select statement after Insert and Update
statements to retrieve identity column values, default values, and other
values calculated by the database.
What I am looking for is a procedure that allows a change to the schema of a
table in a database to get to the typed dataSet table without having to
remove and then re-add the table. The problem is, there are TableAdapters
that then have to be recreated in the newly added table.
Here are the steps I am currently using... (example, add a column to MyTable
called IsActive a bit field)
1) In SQL Server management Studio and Modify MyTable adding column
IsActive, Data Type bit, allow nulls true
2) In Visual Studio, go to the XSD file, drag the updated table MyTable onto
the design surface.
3) Visual Studio will give it a name like MyTable1
4) For each TableAdapter in the original Mytable, create a new one in
MyTable1.
5) Modify each select statement template to perform the function of the one
back in MyTable, taking into account the new Column IsActive
6) Rename MyTable to MyTableOld
7) rename MyTable1 to MyTable
8) Add IsActive to any Update or Insert methods used on any of the
TableAdapters
9) Rebuild and rerun all tests
Is there an easier way to do this? It is a tedious and error prone process,
but I guess this all goes to show, each hour of upfront design saves hours
in development time. Unfortunately, the reality is a designer cannot
foresee all eventualities, marketeers don't always ask for all features
until 10 minutes before ship time and then, there is always the next
version.
Looking at the generated XML behind the design surface (right click, choose
code), it looks like another possiblity is cut and paste XML, but I'd rather
not go there.
Anyway, if anyone can suggest a better process, I'm all ears.... Otherwise,
I'll look forward to this feature in VS.NET 2008 or so! :*)
TIA,
Geo