Sample wanted datarelations with no datagrid

  • Thread starter Thread starter Charles
  • Start date Start date
C

Charles

Is there a sample out there that uses datarelations with
textboxes for both the parent and children? That
updates, adds, and deletes rows from a database in SQL
server 2000? That uses VB.NET 2003? That scrolls
through the children (can this even be done in a
winform?)?

I know about the basics of datarelations, updating,
adding, and deleting. I guess I am not really sure how
that all works with just using text and combo boxes with datarelation
in the mix. All
samples have a datagrid for children that I have found.
Are there any out there that just uses textboxes?

Let me know if you know of a sample someplace, a book
that would get me started, a website that is worth a
look, if you have some
insight of how you would do it.

Been working on this one form for awhile now. I just
want to get rid of it.

TIA,
Charles



..
 
A good book on this is Window Forms by Ian Griffiths. Chapter 10 discusses
databinding and has 2-3 examples without grids using datarelations.
 
Yes, you can definitely do it. If you look for BindingManagerBase or
BindingContext on Google, there are many examples. You bind text boxes for
instance by adding DataBindings. The BindingManager then has a position.
As you navigate through the BMB, all of the bound controls change
accordingly. If you have a DataRelation and you bind to the child table,
the child records pull in. Now, in many instances, if you ahve a parent
record with multiple child records and only one set of textboxes to display
the child, it's never going to be an elegant UI. however, you can use a
DataRelation and have the parents displayed in text boxes and the children
records in a Grid or combobox or list or whatever. Since you don't know in
advance how many child records there will be, you 'd need to have either a
seperate iterator for teh child records, or dynamically add/subtract
controls each time the number of records changed.

http://msdn.microsoft.com/library/d...mwindowsformsbindingmanagerbaseclasstopic.asp

http://www.msdnaa.net/Resources/Display.aspx?ResID=1538

HTH,

Bill
 
Back
Top