Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Example of  VB Linq to SQL one to many update

Posted on 2011-03-07
4
Medium Priority
?
574 Views
Last Modified: 2012-05-11
Does anyone have a good example of how to update a one to many relationship using Linq to SQL in VB?  I can get the parent table updated but am having trouble updating the child tables.  I know how to do it using ASP.NET and love using L2Q in it.  Am now trying to learn the nuances in the syntax for a VB.NET application.  Have been searching the Net for a while on this but haven't found a good explanation.
Thanks for any help in this.
0
Comment
Question by:McGurk1
  • 3
4 Comments
 
LVL 22

Expert Comment

by:plusone3055
ID: 35063324
0
 

Author Comment

by:McGurk1
ID: 35069952
Thanks for the reply.  I searched thru that page yesterday and could find nothing on a many to 1 update or insert.  I will check it out again tho.
0
 

Accepted Solution

by:
McGurk1 earned 0 total points
ID: 35072495
Figured out the insert:
dim db as mydatacontext
dim parent  as new parenttable With _ 
  {.ID = myID, _
   .fieldTwo = textbox2.text, _
    .fieldThree = textbox3.text}

dim child  as new childttable With _ 
  {.childfield1 = textbox4.text, _
    .childfield2 = textbox5.text}

parent.childtables.add(child)
db.parenttables.insertonsubmit(parent)

Open in new window

0
 

Author Closing Comment

by:McGurk1
ID: 35178815
Figured out without EE help
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question