M
Michael McHenry
If you try to create a typed dataset with a table named Locale, the
dataset generator fails to create a unique name (like by using an
underscore) and instead gives you the following compile-time error:
Property or indexer 'xxx.Locale' cannot be assigned to -- it is read
only
You can resolve this by changing the line in your generated DataSet
class
public LocaleDataTable Locale {
to
public LocaleDataTable Locale_ {
But now your typed DataSet is disconnected from the schema designer,
and that's not much fun.
I haven't tried using one of the third-party generators to see if they
fix this problem. I haven't found any other reference to this problem
on the web, so I'm not confident the other generators are any better
about it. It seems like the VS built-in version ought to be able to
handle it.
I realize that if I were using a DataAdapter, I could create a
TableMapping that allowed me to use a different name in the dataset,
but I am getting the data from an XML file. I realize I could use an
XSL to transform the XML to change that one element name, but I don't
like that solution.
What I cannot find is anything in the designer that allows an XML
element of one name to be represented by a differently named table
property in the generated DataSet.
dataset generator fails to create a unique name (like by using an
underscore) and instead gives you the following compile-time error:
Property or indexer 'xxx.Locale' cannot be assigned to -- it is read
only
You can resolve this by changing the line in your generated DataSet
class
public LocaleDataTable Locale {
to
public LocaleDataTable Locale_ {
But now your typed DataSet is disconnected from the schema designer,
and that's not much fun.
I haven't tried using one of the third-party generators to see if they
fix this problem. I haven't found any other reference to this problem
on the web, so I'm not confident the other generators are any better
about it. It seems like the VS built-in version ought to be able to
handle it.
I realize that if I were using a DataAdapter, I could create a
TableMapping that allowed me to use a different name in the dataset,
but I am getting the data from an XML file. I realize I could use an
XSL to transform the XML to change that one element name, but I don't
like that solution.
What I cannot find is anything in the designer that allows an XML
element of one name to be represented by a differently named table
property in the generated DataSet.