473,387 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Binding Manager Remove At question.

In my Form, there is Invoice Master to - InvoiceDetail (one-to-may
relationship)
I use bmMaster.removeat(bmMaster.position) to remove the Master record.
However, I don't know how to remove the Detail records ????
I got relationkey between that two tables.

Dim constraint_tinvno As New ForeignKeyConstraint("fk_tinvno",
dtTvHeader.Columns("tinvno"), dtTvDetail.Columns("tinvno"))
dtTvDetail.Constraints.Add(constraint_tinvno)
dsTvHeader.Relations.Add("fk_tinvno",
dtTvHeader.Columns("tinvno"), dtTvDetail.Columns("tinvno"), False)

Nov 21 '05 #1
2 1008

"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:OS**************@tk2msftngp13.phx.gbl...
In my Form, there is Invoice Master to - InvoiceDetail (one-to-may
relationship)
I use bmMaster.removeat(bmMaster.position) to remove the Master record.
However, I don't know how to remove the Detail records ????
I got relationkey between that two tables.

Dim constraint_tinvno As New ForeignKeyConstraint("fk_tinvno",
dtTvHeader.Columns("tinvno"), dtTvDetail.Columns("tinvno"))
dtTvDetail.Constraints.Add(constraint_tinvno)
dsTvHeader.Relations.Add("fk_tinvno",
dtTvHeader.Columns("tinvno"), dtTvDetail.Columns("tinvno"), False)

Have a look at this article. It covers your area of interest.

http://msdn.microsoft.com/msdnmag/is...05/DataPoints/
--
Peter [MVP Visual Developer]
Jack of all trades, master of none.
Nov 21 '05 #2

"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:OS**************@tk2msftngp13.phx.gbl...
In my Form, there is Invoice Master to - InvoiceDetail (one-to-may
relationship)
I use bmMaster.removeat(bmMaster.position) to remove the Master record.
However, I don't know how to remove the Detail records ????
I got relationkey between that two tables.

Dim constraint_tinvno As New ForeignKeyConstraint("fk_tinvno",
dtTvHeader.Columns("tinvno"), dtTvDetail.Columns("tinvno"))
dtTvDetail.Constraints.Add(constraint_tinvno)
dsTvHeader.Relations.Add("fk_tinvno",
dtTvHeader.Columns("tinvno"), dtTvDetail.Columns("tinvno"), False)

Here's an example code snippet that illustrates what you need to do:

' Creating the DataRelation between Customers and Orders Tables
Dim pCol1 As DataColumn
Dim cCol1 As DataColumn
Dim myFKC1 As ForeignKeyConstraint

pCol1 = dsCustomers.Tables("Customers"*).Columns("Customer ID")
cCol1 = dsCustomers.Tables("Orders").C*olumns("CustomerID" )

Dim CustomersOrders As New DataRelation("CustomersOrders"*, pCol1,
cCol1)
dsCustomers.Relations.Add(Cust*omersOrders)
myFKC1 = New ForeignKeyConstraint("Customer*sOrders1", pCol1, cCol1)
'************************************************* *****************
' By setting the DeleteRule to Rule.Cascade, child table records related to
the parent table
' record you delete will be deleted automatically
myFKC1.DeleteRule = Rule.Cascade
myFKC1.UpdateRule = Rule.Cascade
dsCustomers.Tables("Orders").*Constraints.Add(myFK C1)

--
Peter [MVP Visual Developer]
Jack of all trades, master of none.
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: festiv | last post by:
Hi there, I want to learn how the compiler is implementing the dynamic binding. where can i read about this subject (the hole process). thanks.
1
by: matty.hall | last post by:
There's a lot of information out there about data-binding UI objects (i.e. derived from Control) to non-UI custom business objects. Is it possible to do the same without any UI being involved at...
6
by: Scott Mueller | last post by:
I have a question about simple binding: (please forgive any syntax errors... I am at home, where I do not have Vb.Net installed, and I rely far too much on Vb's intellisense!) If I have two...
11
by: Rourke Eleven | last post by:
I have looked and searched. What good is the databind property on Radiobuttons? How does one go about actually using it? What is a good resource on this? I understand that I can easily get/set...
17
by: ZorpiedoMan | last post by:
Why Doesn't THIS work: ----------------------------------------------------------- A Windows Form has three controls: TextBox1 BindButton ShowTextButton ChangeTextButton Code:
3
by: amber | last post by:
Hello, I have 6 comboboxes, that I thought I could bind to the same datasource, and have them display different 'selectedvalue's', but apparently I can't... My code is as follows: dim drv as...
3
by: =?Utf-8?B?Sm9obiBCdW5keQ==?= | last post by:
New to databinding in vs2005, I always did it manually in 2003. I have no problem loading comboboxes, and a change in that combobox changes the data in the textboxes but I can not figure out a way...
5
by: star-italia | last post by:
My XAML is the following: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Style...
6
by: Tomasz J | last post by:
Hello developers, I bind my TextBox control specyfying a format stored in my application global ApplicationContext object - it has a static string CurrencyFormat property. The problem - this...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.