I have 2 tables in SqlServer 2008.
Table1: T1id, SomeData
Table2: T2id, T1id, SomeData
I am using DataAdapter.FillSchema to create shema of tables in DataSet. I created DataRelation on columns T1id in both tables.
Now when i try to Update Sql Database T1id in Table2 remains 0 and not the value of T1id in Table1.
I can successfully update Sql Database if i fill DataSet with records first (Using DataAdapter.Fill), but that's not what i want to do. I don't need "old" records in my dataset. I want to use dataset just to store all imputs from user until the proccess is done and then insert all those records "at the same time".
I think i'm getting it wrong with ForeignKeyConstraints, maybe UpdateRule is not set to cascade, i just don't know.
I have been trying to work this out for 6 days now and i'm about to break something on half.
Can someone please guide me to right direction, maybe post some sample, anything.... please!
My old post regarding this:
How to update Sql Server related tables from Dataset(SchemaFill)
SqlDataAdapter.Update related tables
View Complete Post