Groups | Blog | Home
all groups > dotnet xml > september 2003 >

dotnet xml : minOccurs in XML Schema for Datset



leeatkinsonlincs NO[at]SPAM hotmail.com
9/4/2003 4:43:01 AM
Hi

What effect does the presence of minOccurs attribute with columns
defining the tables for a dataset? I understand that, if it is set to
minOccurs=0, then the element does not have to appear in XML using the
XSD, but how does that effect the dataset? Does it allow a dataset to
be filled with a DataAdapter that does not provide that particular
column as output?

Ross Donald
9/13/2003 7:31:48 PM
Hi Lee,

If your XSD has minOccurs="1" then DBNull values are not allowed in the
column in the strongly-typed DataSet.

The xsd.exe tool generates code like this:
this.MyRequiredColumn.AllowDBNull = false;

The Set<columnname>Null() and Is<columnname>Null() methods are also not
generated.

--
Ross Donald
Rad Software
Get Intellisense when working with XSL in Visual Studio .NET
http://www.radsoftware.com.au/web/CodeZone/Articles/XSLIntellisenseInVisualStudio.aspx

[quoted text, click to view]
| Hi
|
| What effect does the presence of minOccurs attribute with columns
| defining the tables for a dataset? I understand that, if it is set to
| minOccurs=0, then the element does not have to appear in XML using the
| XSD, but how does that effect the dataset? Does it allow a dataset to
| be filled with a DataAdapter that does not provide that particular
| column as output?
|
| Many thanks, Lee

AddThis Social Bookmark Button