Re: How do you set a value to Null in a DataSet when it's normally set to another table through a relation

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: W.G. Ryan eMVP (WilliamRyan_at_NoSpam.gmail.com)
Date: 10/22/04


Date: Thu, 21 Oct 2004 20:21:21 -0400

If it doesn't reference the other table at all it's an Orphan which is what
the key there to prevent. You can try disabling the constraints but I
think that'd be a bad choice.

-- 
W.G. Ryan MVP (Windows Embedded)
TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Benny Raymond" <benny@pocketrocks.com> wrote in message
news:aJXdd.20086$l07.13127@twister.nyroc.rr.com...
> I currently have a relation set up between two tables in my dataset.
> Sometimes I'd like to set the value in the Foreign Key Field to NULL (if
> it doesn't refrence the other table at all).
>
> Currently i'm getting an error no matter what I try to use:
> 0
> Nothing
> Convert.DBNull
>
> Does anyone have experience in this area?  I posted this question a few
> days ago, but I didn't have as clear of an understanding as I do right
> now.  Currently I can set this field to Null using the data grid,
> however I havn't been able to figure out how to add a row with this
> field set to Null - it always gives an error :(
>
> ~Benny


Relevant Pages

  • Re: How to disable foreign key constraints in a stored procedure?
    ... constraints, perform some actions, and then re-enable them. ... My suggestion would be to re-think your 'reasoning' for disabling the ... Suppose you want to bulk load data into database - the data is coming ... Could you guarantee no other connected user ...
    (comp.databases.oracle.server)
  • Re: Managed Com Add in Disabled automatically
    ... The "LoadBehavior" specified in the registry entry is changed from 3, ... I've used Com Shim Wizard for VS.NET 2005 and it seems to work fine. ... Is there a reference that I'm missing? ... code is resulting in an app crash and thus the host app is disabling ...
    (microsoft.public.office.developer.com.add_ins)
  • Re: Storing codes vs. human-intelligible values - best practice?
    ... The child tables referencing these domain tables use the COL_NM human ... -- Can't use check constraints (and wouldn't want to; ... On the other hand if three or more table will reference this column ... you definitely want to use a lookup table. ...
    (comp.databases.oracle.server)
  • Managed Com Add in Disabled automatically
    ... There are no warnings or event log messages regarding the disabling of ... The "LoadBehavior" specified in the registry entry is changed from 3, ... I've used Com Shim Wizard for VS.NET 2005 and it seems to work fine. ... Is there a reference that I'm missing? ...
    (microsoft.public.office.developer.com.add_ins)
  • Re: A real world example
    ... If a constraint is defined in terms of successive states of a database, ... Yes, that's all facts are, though constraints mean that your facts are ... value of a candidate key determines the values of all other attributes, ... The frame of reference for a candidate key is a ...
    (comp.databases.theory)