"does not allow nulls" errors

  • Thread starter Thread starter Karim
  • Start date Start date
K

Karim

I am using typed datasets and I am getting "does not allow nulls" errors
when I add new datarows. Where in the schema (xsd file) does asp.net know
that a column is required? I do not want to add default values for each
column.

Karim
 
I am using typed datasets and I am getting "does not allow nulls" errors
when I add new datarows. Where in the schema (xsd file) does asp.net know
that a column is required? I do not want to add default values for each
column.

It's in the element for the column, add the minOccurs attribute to
allow nulls.

<xs:element name="mycolumn" type="xs:string" minOccurs="0" />

Obviously, that doesn't affect the actual database, though, so if the db
doesn't allow nulls on the column you'll get errors when you update.
 
If this is a typed DataSet, then it gets this requirement from the DB
itself.

A dataset is a disconnected object from the database. There has to be
something in the disconnected schema telling it not to allow nulls. I am
just not very well versed in xml schema syntax.

The thing is that the first time I created the dataset through the adaptor,
it didn't happen, I recreated it and now this comes up. Nothing changed in
teh database and I went through the same process.

Karim
 
Back
Top