Repost using registered alias:

I have an existing .xsd file with typed dataset information in it. I need the
ability to update this existing schema information when a column is removed
from one of the underlying data adapters.

Currently I read the existing schema info into a temp dataset object, update
the schema for the table in question by just calling MyAdapter.FillShema and
passing it my temp dataset. I then write the schema file back to disk.

This works great for column additions, the new columns are placed in the
schema, but it does not change the schema if a column is deleted.

I've been searching through the merge documentation, the MissingSchemaAction
documentation, anything I can think of, but I'm at a loss.

Any ideas or pointers in a new direction?

TIA

Re: Updating typed dataset schema from code by Sahil

Sahil
Thu May 26 14:48:03 CDT 2005

> I have an existing .xsd file with typed dataset information in it. I need
the
> ability to update this existing schema information when a column is
removed
> from one of the underlying data adapters.

You mean from the underlying database that the data adapter connects to?

Just regenerate the xsd programmatically and overwrite the previous xsd.
Then programatically generate and compile the strongly typed dataset.
Obviously this should be a once in a while thing or your performance will
suck i.e. don't do this in a real time system.

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/





"jeremym1234" <arul@usa.com> wrote in message
news:3513B711-0E9F-4A91-9A84-7A8BB9A9AF3F@microsoft.com...
> Repost using registered alias:
>
> I have an existing .xsd file with typed dataset information in it. I need
the
> ability to update this existing schema information when a column is
removed
> from one of the underlying data adapters.
>
> Currently I read the existing schema info into a temp dataset object,
update
> the schema for the table in question by just calling MyAdapter.FillShema
and
> passing it my temp dataset. I then write the schema file back to disk.
>
> This works great for column additions, the new columns are placed in the
> schema, but it does not change the schema if a column is deleted.
>
> I've been searching through the merge documentation, the
MissingSchemaAction
> documentation, anything I can think of, but I'm at a loss.
>
> Any ideas or pointers in a new direction?
>
> TIA
>
>



Re: Updating typed dataset schema from code by arul

arul
Thu May 26 15:04:04 CDT 2005

Yes, I mean some database columns might have been removed.

The dataset can contain other table definitions from other data adapters
too. I don't want to lose those definitions, which I think I would with your
suggested approach.

This is used by a design-time tool, so performance is not a big concern.

Any other ideas?

Thanks for your time,
J.D.

"Sahil Malik [MVP]" wrote:

> > I have an existing .xsd file with typed dataset information in it. I need
> the
> > ability to update this existing schema information when a column is
> removed
> > from one of the underlying data adapters.
>
> You mean from the underlying database that the data adapter connects to?
>
> Just regenerate the xsd programmatically and overwrite the previous xsd.
> Then programatically generate and compile the strongly typed dataset.
> Obviously this should be a once in a while thing or your performance will
> suck i.e. don't do this in a real time system.
>
> - Sahil Malik [MVP]
> http://codebetter.com/blogs/sahil.malik/
>
>
>
>
>
> "jeremym1234" <arul@usa.com> wrote in message
> news:3513B711-0E9F-4A91-9A84-7A8BB9A9AF3F@microsoft.com...
> > Repost using registered alias:
> >
> > I have an existing .xsd file with typed dataset information in it. I need
> the
> > ability to update this existing schema information when a column is
> removed
> > from one of the underlying data adapters.
> >
> > Currently I read the existing schema info into a temp dataset object,
> update
> > the schema for the table in question by just calling MyAdapter.FillShema
> and
> > passing it my temp dataset. I then write the schema file back to disk.
> >
> > This works great for column additions, the new columns are placed in the
> > schema, but it does not change the schema if a column is deleted.
> >
> > I've been searching through the merge documentation, the
> MissingSchemaAction
> > documentation, anything I can think of, but I'm at a loss.
> >
> > Any ideas or pointers in a new direction?
> >
> > TIA
> >
> >
>
>
>