Re: Looking for code sample to inset master and detail typed recordset
- From: "William Vaughn" <billvaNoSPAM@xxxxxxxxx>
- Date: Thu, 16 Aug 2007 18:32:33 -0700
I'm not exactly sure what you're trying to do or why you're taking this path, but Parents must be created before children. Didn't your mom talk to you about the birds and the bees?
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------
"Fred Goodrum - Alemarck Corp." <FredGoodrumAlemarckCorp@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:10B575B4-0B2E-4E00-A15B-8B0CAC5FD881@xxxxxxxxxxxxxxxx
I've followed the wizard to create a dataset. This datset has two tables, one
master, and one child. I've also had the wizard create stored procedres for
select, insert,....
I am not binding the data. Instead I've taken a form and am inserting the
records manually (No selects, deletes, or updates). The code follows the
following logic.
A constraint violation is thrown when I add the master row. I believe that I
am not following the correct method to perform this update. Unfortunately,
Every book and search have gone to great detail to discuss alternate methods.
where is my misunderstanding in how this process should be written?
Dim sc As New Scenario
Dim dr As DataRow = sc.ScenarioDetail.NewRow()
Dim mr As DataRow = sc.ScenarioMaster.NewRow()
.
.
<Update row mr>
<update row dr >
.
.
dr.SetParentRow(mr)
sc.ScenarioMaster.Adduwm_QLSS_ScenarioMasterRow(mr)
sc.ScenarioDetail.Adduwm_QLSS_ScenarioDetailRow(dr)
Dim ma As New ScenarioTableAdapters.ScenarioMasterTableAdapter
Dim da As New ScenarioTableAdapters.ScenarioDetailTableAdapter
Dim rw As Integer
rw = ma.Update(sc)
rw = da.Update(sc)
.
- Prev by Date: Re: How does sql ExecuteReader() work?
- Next by Date: Re: How does sql ExecuteReader() work?
- Previous by thread: Re: How does sql ExecuteReader() work?
- Next by thread: Closing recordset generates exception
- Index(es):
Relevant Pages
|
|