DataBinding - I'm getting sick of it!
-
Ok, I thought databinding in .NET would be oh so simple, turns out, I'm finding that I am writing the same code whether I Bind or Not! All of these stupid little examples on MessageBoards and MSDN suck! They never cover the REAL topic! How the heck do you save data to the DataView you've bound to, and then, once you re-populate your Data from the Database, how do you rebind your Controls? Or do you even need to!?? Well, here's what I am running into. First off, DataBinding works great! I can Bind and Navigate Records with ease. However, when I go to save, I run into problems since I am using
DataRelations
. I cannot use theBindingManagerBase
of the Form to call "Me.BindingContext(Data).EndCurrentEdit" because then all my changes in Child Tables are GONE! Gone I tell you!!! So, I am forced to use DataRowView variables when attempting to Save, which I connect toMe.BindingContext(Data).Current
andMe.BindingContext(Data, DataMember).Current
respectively and then call the "EndEdit" Method of those Rows. However, this causes an additional problem. Now, I have to write code which forces the values of my Controls into the Values of theDataRowView
Variables (ex. dRow("Column") = TextBox1.Text)! So in other words...I just lost my DataBindings!??? What the @##$% is going on here!? :wtf: Has anybody in the world actually got DataBinding to work with a DataSet that has multiple Child Relations?