Add/Change Column names

I started using a typed datatable.   Now, of course, I want to change a column name, and will want to add/delete columns going forward.   I see three steps:

A)  make the changes in the DB
B)  make the changes in the XML Schema for the typed data set
C)  make the changes in the code

What's the best approach for making the changes in the XML Schema?  Edit the schema directly?  Regenerate the table adapter?  Other?   Did I leave out something else important?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

IN the .vb page change the dataadapter in the property "SelectCommand" with the new columns, and then press in the bottom "Generate Dataset". VB.Net automatically generate the new xml schema.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The table adapter will change the XML schema for you. Regenerating the table adapter should work, but you don't have to. You can go to the dataset designer (go to the DataSources tab and right click on the dataset you want to modify, choose "Edit DataSet with Designer"), then go to the tableadapter's property page where you can modify the SelectCommand's CommandText. Click on "..." and a Query Builder is opened where you can modify the columns. After you click OK on the Query Builder, it will prompt you whether you want to regenerate the UpdateCommand, click Yes and it's done automatically for you.
codequestAuthor Commented:
Thanks for the input.   In this case I'm not defining the dataadapter on a page...I'm using a dataset item in App_Code.  However, because of your message, I guessed that it wasn't that tricky, so I:

> deleted the table in the dataset designer,
>  changed the DB definition (SQL Server Express)
> dragged the table from the DB back into the designer
> selected configure on the table in the designer (right click) and made some adjustments
> completed configuration
> updated the vb field calls

and it worked on the first try.

Next time maybe I'll look for a way to update it without the delete and re-add.

Thanks for the prompt...that's what did it.

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

While you are on the dataset designer, you could also right click on the datatable name and choose "Configure...". This will open the TableAdapter Configuration Wizard where you can edit the query.
You mentioned table adapter in your question, which made me think that you are using VB2005, LOL. Anyway, when you upgrade to 2005, that's the step you can use.
codequestAuthor Commented:
amyhxu:  thanks for the response...I saw it too late.  Please look for question "amyhxu  Q_21798590 additional points" for additional points...I'll accept a response from you there.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.