Assign schema to already populated datatable

A

Adam

Hi, is it possible to associate a schema with an already populated
datatable?

I have a untyped datatable being returned from an external method.

I tried to use the DataTable.ReadXmlSchema method but it does not
work.

Thanks
Adam
 
A

Alberto Poblacion

Adam said:
Hi, is it possible to associate a schema with an already populated
datatable?

I have a untyped datatable being returned from an external method.

It is not clear what you want. If you are receiving a populated
DataTable, then it already HAS a schema. Unless you are referring to
something different. By "schema" we usually mean a list of columns with
their types. If the DataTable is populated, then it must already have
columns, and they must each have a type.
 
I

Ignacio Machin

Hi, is it possible to associate a schema with an already populated
datatable?

I have a untyped datatable being returned from an external method.

I tried to use the DataTable.ReadXmlSchema method but it does not
work.

Thanks
Adam

I think you have a problem understanding the concept, a datatable
(also a dataset) does not have an explicit schema, what they have are
a collection of columns (tables for dataset) and also relationship
among them. This is what is considered the schema.

In other words a datatable ALWAYS have a schema, if you want to change
the schema you have to change the columns and/or the constrains of the
table
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top