Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Example of  VB Linq to SQL one to many update

Posted on 2011-03-07
4
Medium Priority
?
572 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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 …
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

722 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