Jon,
I think you misunderstand. See inline:
> I *can* change the name of a table in a database by "downloading" (with a
> DataAdapter) it into a DataTable, changing the TableName property, and
> "uploading" it back to the database (using the same DataAdapter's Update()
> method)
You can change the name of the data set/data table on the client side.
This has no effect on the server side. If you change the table name, then
you have to change the data adapter so that it recognizes the new table you
are trying to update. You can call Update again, but it will fail because
the table mapping is off (I believe). Also, the new columns will be
ignored. If you want to update the data into another table, then that table
must already exist, and have a schema compatable with the changes you have
made to your data table.
>
> I *can* add new columns to said table, and have those "uploaded" into the
> database as well
>
> I *can* rename existing columns in the table, and have them renamed in the
> database
>
> I *can* change the data type of a column in the table, and have that
> reflected in the database
The changes you make are to the client side data set only. Any changes
you make to that do not affect the underlying DB. You will have to issue
DB-specific commands in order to modify table structures in the DB itself.
ADO.NET does not provide this for you.
--
- Nicholas Paldino [.NET/C# MVP]
-
(E-Mail Removed)
>
> If so, how? As the code I orginally posted does not work.
>
> Nicholas Paldino [.NET/C# MVP] wrote:
>
>> Jon,
>>
>> It is possible, but you will have to change the Update, Insert, and
>> DeleteCommand properties to reflect the commands to perform the
>> associated operations on the other table that you want to update.
>>
>> Also, you have to make sure that whatever changes you make in the
>> dataset (as far as data, not schema) have to make sense in the new table
>> you want to update (for example, an edit of a row needs to have a
>> pre-existing row).
>>
>> Hope this helps.
>>