Click here to Skip to main content
16,012,821 members
Home / Discussions / C#
   

C#

 
GeneralRe: New posts emailed - please be kind Pin
Luc Pattyn8-Jun-10 9:36
sitebuilderLuc Pattyn8-Jun-10 9:36 
QuestionUnable to Build Release Version of Program Pin
MWRivera7-Jun-10 8:54
MWRivera7-Jun-10 8:54 
QuestionRe: Unable to Build Release Version of Program Pin
MWRivera7-Jun-10 9:27
MWRivera7-Jun-10 9:27 
AnswerRe: Unable to Build Release Version of Program Pin
MWRivera7-Jun-10 9:53
MWRivera7-Jun-10 9:53 
GeneralRe: Unable to Build Release Version of Program Pin
mprice2147-Jun-10 18:04
mprice2147-Jun-10 18:04 
GeneralRe: Unable to Build Release Version of Program Pin
MWRivera8-Jun-10 3:09
MWRivera8-Jun-10 3:09 
GeneralRe: Unable to Build Release Version of Program Pin
mprice2148-Jun-10 3:51
mprice2148-Jun-10 3:51 
QuestionHow to use DataBinding/DataSets to INSERT both a row in a parent table, and its CHILD table rows (matched by key) at the same time (or right after) Pin
Draekz7-Jun-10 8:49
Draekz7-Jun-10 8:49 
Hey All,

I'm having a concept issue with DataBinding in C# and VS.NET 2010.

I have a Table, MyTable, it contains a record which is displayed in a form (all fields bound), and i have a save button.

Then I have another Table, MyTableSpecs, it contains MANY records. These all have the same key, so that the table, and the tablespecs go together. I use this relationship to bind the grid that shows the specs rows.

When a user is vieweing an existing records already in the database, everything works fine. At the top I see the fields of the MyTable row, then in the GridView I see the MyTableSpecs that match key with MyTable. when i save these, it all works.

Problem comes with creating NEW records (and Identity I don't think is the issue (The ID field of both tables is a INT, auto-incremented from 0).

But when i am creating a NEW record, I have problems. I do not want to FIRST submit the top part of the window (therefore the MyTable record) BEFORE the user enters in the child rows in the Grid. I want both the fields at the top AND the grid to be populated first, and THEN i want it to commit both in order, MyTable record first, then each MyTableSpecs rows. If the grid was not databound, I would just apply the data myself and it would work, but I want to use DataBinding, surely it can perform this task...

The problem is, once I save the top record at the top using BindingSource.EndEdit(); and then TableAdapter.Update(Data.MyTable);
ALL of the data in the MyTableSpecs Grid/BindingSource disappear!

So I can't commit them anymore... They dont stick around and get the ID itself, I dont even get the chance to APPLY them either, because the whole binding is empty.

Can someone tell me what I'm fundamentally misunderstanding, or do I have to commit the top part first, THEN let the user fill out the grid and then save the rows??? (i hate this idea, NOT user friendly)

I know I could just remove the databinding altogether, but I didn't want to have to do that...

Any help would be appreciated.

Phil

modified on Monday, June 7, 2010 5:22 PM

AnswerRe: How to use DataBinding/DataSets to INSERT both a row in a parent table, and its CHILD table rows (matched by key) at the same time (or right after) Pin
Mycroft Holmes7-Jun-10 19:15
professionalMycroft Holmes7-Jun-10 19:15 
GeneralRe: How to use DataBinding/DataSets to INSERT both a row in a parent table, and its CHILD table rows (matched by key) at the same time (or right after) Pin
Draekz8-Jun-10 4:12
Draekz8-Jun-10 4:12 
QuestionMouseLeave event triggered on the wrong window Pin
martingeorgiev7-Jun-10 8:43
martingeorgiev7-Jun-10 8:43 
AnswerRe: MouseLeave event triggered on the wrong window Pin
Andrew Rissing7-Jun-10 8:53
Andrew Rissing7-Jun-10 8:53 
GeneralRe: MouseLeave event triggered on the wrong window Pin
martingeorgiev7-Jun-10 8:57
martingeorgiev7-Jun-10 8:57 
GeneralRe: MouseLeave event triggered on the wrong window Pin
Andrew Rissing7-Jun-10 9:06
Andrew Rissing7-Jun-10 9:06 
GeneralRe: MouseLeave event triggered on the wrong window Pin
Andrew Rissing7-Jun-10 9:17
Andrew Rissing7-Jun-10 9:17 
GeneralRe: MouseLeave event triggered on the wrong window Pin
martingeorgiev7-Jun-10 9:20
martingeorgiev7-Jun-10 9:20 
QuestionRIP BASED SOFTWARE ROUTER FOR WINDOWS using C# Pin
Member 32734627-Jun-10 7:29
Member 32734627-Jun-10 7:29 
Questionusing and close Pin
imbiz7-Jun-10 7:16
imbiz7-Jun-10 7:16 
AnswerRe: using and close Pin
Keith Barrow7-Jun-10 7:23
professionalKeith Barrow7-Jun-10 7:23 
GeneralRe: using and close Pin
imbiz7-Jun-10 9:20
imbiz7-Jun-10 9:20 
GeneralRe: using and close Pin
Chris Trelawny-Ross7-Jun-10 14:01
Chris Trelawny-Ross7-Jun-10 14:01 
GeneralRe: using and close Pin
imbiz7-Jun-10 14:46
imbiz7-Jun-10 14:46 
GeneralRe: using and close Pin
harold aptroot7-Jun-10 9:51
harold aptroot7-Jun-10 9:51 
AnswerRe: using and close Pin
harold aptroot7-Jun-10 7:25
harold aptroot7-Jun-10 7:25 
GeneralRe: using and close Pin
imbiz7-Jun-10 8:37
imbiz7-Jun-10 8:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.