Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. LINQ
  4. How can write vb SQL insert code in linq

How can write vb SQL insert code in linq

Scheduled Pinned Locked Moved LINQ
csharpdatabaselinqquestion
3 Posts 3 Posters 8 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 7987889
    wrote on last edited by
    #1

    Hi all How can I use with linq command like this: INSERT INTO tablename1 (column1, column2, column3,...) SELECT (column4, column5, column6,...) FROM tablename2 I hop to be clear :| Thanes

    R M 2 Replies Last reply
    0
    • U User 7987889

      Hi all How can I use with linq command like this: INSERT INTO tablename1 (column1, column2, column3,...) SELECT (column4, column5, column6,...) FROM tablename2 I hop to be clear :| Thanes

      R Offline
      R Offline
      rafaelmartir
      wrote on last edited by
      #2

      I think you could do something like this:

      var SeletcToInsert = from tbl2 in tablename2
      where ...
      select new A
      {
      ...
      };

      tablename1.InsertAllOnSubmit(toInsert);
      dc.SubmitChanges();

      1 Reply Last reply
      0
      • U User 7987889

        Hi all How can I use with linq command like this: INSERT INTO tablename1 (column1, column2, column3,...) SELECT (column4, column5, column6,...) FROM tablename2 I hop to be clear :| Thanes

        M Offline
        M Offline
        muqtdeer mohd
        wrote on last edited by
        #3

        :-O :rolleyes: :(( :sigh: :zzz: hi insert into tablename (seelct column4, column5, column6,.. from tablename1)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups