Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Linq to SQL Datasouce Question
Message
 
To
29/07/2009 18:50:42
General information
Forum:
ASP.NET
Category:
LINQ
Environment versions
Environment:
C# 3.0
Miscellaneous
Thread ID:
01415422
Message ID:
01415717
Views:
41
>Here's a newbie question
>
>I have a SQL server portfolio database with 3 tables - holding, owner, safekeeper.
>The holding table keeps the postion data and the other two are reference tables
>
>I created LING to SQL classes from the DB, created a datasource from the obects.
>
>I created screens to add, delted and change owners and safekeepers by dragging the objects from the data source, added a couple of lines of code, and they're rocking and rolling.
>
>Now I'd doing the holding form. I dragged all the fields over from the object and all is well with one exception:
>
>When I change the ownerID field in the holding table, the text box appears to changes but the save ignores the changes.
>Before the change, the textbox displays the correct value, but it won't take the change.
>Other fields, such as face value, maturity date, etc, save as they should, but not the ownerID. The databinding doesn't seem to be working, but I checked and it's there and pointing at the ownerID field.
>
>I put relationship in the DB to indicate that ownerID is a foreign key relating to the owner table, and I can see that the datasouce has done something with those relationships- but I can't find any reference to tell me what to do with them., if anything, or how they affect databinding.
>
>Any clues?
----------------------------

Are you writing the code to update the object that is getting stored, or is this done aujomagicly?

If you have a constraint in the db between the tables you will NOT SEE the fkey in the child table to update. It has been a year since I did this so I can't just copy code for you.

Try this page:
http://www.hookedonlinq.com/LINQtoSQL5MinuteOverview.ashx
Previous
Reply
Map
View

Click here to load this message in the networking platform