Hi,
using LinqToOracle in a master detail scenario, if i add detail row and then i remove the same row, when i call SubmitChanges the provider try to insert null row that raise an exception.
What can i do?
Master-Detail
-
- Posts: 29
- Joined: Wed 07 Oct 2009 07:24
DataContext1.Table1 tab1 = FDb.Table1s.First();
tab1.Table2s.Add(new DataContext1.Table2());
tab1.Table2s.Add(new DataContext1.Table2());
tab1.Table2s.Add(new DataContext1.Table2());
tab1.Table2s.Add(new DataContext1.Table2());
tab1.Table2s.Add(new DataContext1.Table2());
tab1.Table2s.Add(new DataContext1.Table2());
tab1.Table2s.Add(new DataContext1.Table2());
tab1.Table2s.Add(new DataContext1.Table2());
while (tab1.Table2s.Count() > 0)
tab1.Table2s.RemoveAt(0);
FDb.Log = Console.Out;
FDb.SubmitChanges();
tab1.Table2s.Add(new DataContext1.Table2());
tab1.Table2s.Add(new DataContext1.Table2());
tab1.Table2s.Add(new DataContext1.Table2());
tab1.Table2s.Add(new DataContext1.Table2());
tab1.Table2s.Add(new DataContext1.Table2());
tab1.Table2s.Add(new DataContext1.Table2());
tab1.Table2s.Add(new DataContext1.Table2());
tab1.Table2s.Add(new DataContext1.Table2());
while (tab1.Table2s.Count() > 0)
tab1.Table2s.RemoveAt(0);
FDb.Log = Console.Out;
FDb.SubmitChanges();
-
- Posts: 29
- Joined: Wed 07 Oct 2009 07:24
An the output windows diplay this:
INSERT INTO MAGAZZINO.TABLE2 (ID_TABLE1, CODICE, DESCRIZIONE) VALUES (:p1, :p2, :p3) RETURNING ID INTO :ret1
ParameterName = p1
DbType = Decimal
Value =
ParameterName = p2
DbType = String
Value =
ParameterName = p3
DbType = String
Value =
ParameterName = ret1
DbType = Decimal
Value =
INSERT INTO MAGAZZINO.TABLE2 (ID_TABLE1, CODICE, DESCRIZIONE) VALUES (:p1, :p2, :p3) RETURNING ID INTO :ret1
ParameterName = p1
DbType = Decimal
Value =
ParameterName = p2
DbType = String
Value =
ParameterName = p3
DbType = String
Value =
ParameterName = ret1
DbType = Decimal
Value =