Re: Dataset constraint violoation with null foreign key value by Martin
Martin
Thu Jun 17 06:04:59 CDT 2004
Hi Miha,
Sounds good. I don't see that property reflected in the properties for the
field element in my typed dataset. I'm looking at the xsd file in vs.net
??
Martin
"Miha Markic [MVP C#]" <miha at rthand com> wrote in message
news:%23YlPrKFVEHA.3944@tk2msftngp13.phx.gbl...
> Hi Martin,
>
> DataColumn.AllowDBNull perhaps.
> BTW, to find out which row is causing errors, just iterate through all
rows
> and check DataRow.HasErrors and RowError properites.
>
> --
> Miha Markic [MVP C#] - RightHand .NET consulting & development
> miha at rthand com
> www.rthand.com
>
> "Martin" <x@y.z> wrote in message
> news:u%232ZDWEVEHA.3656@TK2MSFTNGP11.phx.gbl...
> > Hi,
> >
> > I'm loading a dataset from a cached viewstate version of the dataset
> created
> > on a previous http request. When I read the call ReadXml on the typed
> > dataset, I get:
> > "Failed to enable constraints. One or more rows contain values violating
> > non-null, unique, or foreign-key constraints"
> > I suspect this is due to a field in one of the tables which can be null,
> but
> > if it is not null it is a foreign key to another dataset table. At
> present
> > the field in this table is null (in the database).
> >
> > What attributes of the dataset table field, or the dataset constraint
> should
> > I set to indicate null values don't violate the constraint?
> >
> > Thanks
> > Martin
> >
> >
>
>