Results 1 to 2 of 2

Thread: [2008] LINQ question

Hybrid View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2008
    Posts
    263

    [2008] LINQ question

    I have VS automatically generate classes for my tables in my database. One of these classes is a Order class. The Order class has CustomerID, ContactID, OrderNoteID, OrderDateID, etc. THe problem I am having is when I try and add a new order it is trying to add a new Customer, and new Contact, and new Address all into their respective tables. This is because it has EntityRef(Of Customer), EntityRef(Of Contact), etc.

    But this is obviously absurd. Just because my Orders table has a foreign key to the Customer table does not mean that I want it to add a new customer each time I add an order.

    Does anyone have any experience with this stuff who could help?

    THanks.

  2. #2
    PowerPoster Jenner's Avatar
    Join Date
    Jan 2008
    Location
    Mentor, OH
    Posts
    3,712

    Re: [2008] LINQ question

    Let's see your code as to how you're trying to add a new order. Also, you may want to change the post title to "LINQ to SQL question", because the whole side of LINQ that talks directly to SQL databases is separate and in it's own little world from the rest of LINQ.
    My CodeBank Submissions: TETRIS using VB.NET2010 and XNA4.0, Strong Encryption Class, Hardware ID Information Class, Generic .NET Data Provider Class, Lambda Function Example, Lat/Long to UTM Conversion Class, Audio Class using BASS.DLL

    Remember to RATE the people who helped you and mark your forum RESOLVED when you're done!

    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. "
    - Albert Einstein

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width