DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Thu, 16 Aug 2007 18:23:37 -0700,    posted on: microsoft.public.dotnet.framework.adonet        back       

Thread Index
  1    Fred Goodrum - Alemarck Corp.


new Child/parent parent record in typed dataset.   
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, etc.

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 
logic below.

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.ScenarioDetail.Adduwm_QLSS_ScenarioDetailRow(dr)
     sc.ScenarioMaster.Adduwm_QLSS_ScenarioMasterRow(mr)
     Dim ma As New ScenarioTableAdapters.ScenarioMasterTableAdapter
     Dim da As New ScenarioTableAdapters.ScenarioDetailTableAdapter
     Dim rw As Integer
     rw = ma.Update(scenario) <=Constraint error thrown.
     rw = da.Update(scenario)

Is this the scenaio where I have to create a handler to retrieve the @@SCOPE 
and update the detail key manually? -Or-
Am I suppose to set something else up for this to happen "behind the scenes"?
while I wait for an answer. I'm going to rebuild the webform and try just 
binding it to the form.
Date:Thu, 16 Aug 2007 18:23:37 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us