How to Update an existing schema on a typed dataset

  • Thread starter Thread starter socamb
  • Start date Start date
S

socamb

I need to do what seemes a simple task, but i am stuck. I have a
column in my database i need to change from 7 chars to 10 chars. I
have a number of strongly typed datasets in my system that use this
table.


I attempted to edit the xsd file in the designer and changed the 7 to
a 10.


But the underlaying class file did not get updated. When i searched
for the column i need to change it still was set to 7.


Then I attempted to run the "Table Adapter Configuration Widard".
This
actually broke the application and it would not compile. I then
noticed that duplicate colmns appeared in the table in the dataset.
For example there was ProjectId and ProjectId1. ProjectId1 did not
exist before.


I hope i am missing something simple here.


I did change the code generated files to widen the columns in
question
and the app seemed to work ok, but i am sure this is not the prefered
way to go,


any help would be appreciated.
 
As mentioned in another group, you can regenerate the STD from the XSD.
There is a tool on the right click menu for this.

Other options:
1. Exclude the current one from the project and then copy the bits from the
XSD to a new XSD with the same name
2. Use the XSD.exe tool on the XSD file
3. Rebuild by hand
4. Hand edit

Since you are using table adapters, the original suggestion or #4 are
probably your best option.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************************************************
| Think outside the box!
|
*************************************************
 
You have just stumbled upon one of the dangers of using the dataset designer
with table adapters. In my opinion, it's best not to use table adapters.
Go back to the VS 2003 way of doing things - create a component and drag
data adapters onto the design surface. Initially generate the dataset from
there. Thereafter, edit the XSD in the designer and rebuild the project.
 
Back
Top