"does not allow nulls" errors

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
 
D

David

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.
 
K

Karim

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
 

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