HighTechTalks DotNet Forums  

Strange configuration choices

Dotnet Framework (WinForms DataBinding) microsoft.public.dotnet.framework.windowsforms.databinding


Discuss Strange configuration choices in the Dotnet Framework (WinForms DataBinding) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Ken Foskey
 
Posts: n/a

Default Strange configuration choices - 02-11-2009 , 07:25 PM







I have converted a table from autnums to natural keys and suddenly my
application goes totally wrong. I cannot commit any changes.

I am using the generated typesafe classes and the generated classes are
set up so that they give you:

The record cannot be deleted or changed because table YYY includes related
records

I found this:

http://www.devnewsgroups.net/group/
microsoft.public.dotnet.framework.adonet/topic46811.aspx

quote:

parent table has a primary key parent_id
child table has a primary key parent_id, child_id
foreign key is defined for parent_id

dataset generated with all the propery keys and relationships

I get the error when trying to update the parent table unless i manually
change the Dataset.Designer.vb to remove the parent_id from the set
portion
of the update command.

endquote:

Why does the generated SQL update statements automatically include the
primary key that automatically breaks the ability to update the records
if it is a primary key on another relationship.

Is there a fundamentally better design here? This has cost me a couple
of days figuring it out.

Ta
Ken

Reply With Quote
  #2  
Old   
Ken Foskey
 
Posts: n/a

Default Re: Strange configuration choices - 02-12-2009 , 04:49 AM







I eventually got this working by:

Using configuration to build the SQL statements.

Editing the Update SQL in the Table Adaptor, removing the primary keys
from the update (set clause)

There were still some residual problems. So I then looked at the SQL
again and I had to remove all but the primary keys from the where
clause. This now works correctly.

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.