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. Retrieveing Multiple Tables From Stored Procedure using LINQ

Retrieveing Multiple Tables From Stored Procedure using LINQ

Scheduled Pinned Locked Moved LINQ
databasecsharplinqsalestutorial
3 Posts 3 Posters 0 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.
  • V Offline
    V Offline
    Vishal09
    wrote on last edited by
    #1

    Hi There, This Task I Had Done Using Below Code Where I Had Used Simple SQL Connection. Now I Want to do This with Linq to SQL.Can Any one Tell me How to Do This. string name=string.Empty; SqlConnection cn= new SqlConnection("Data Source=ASP4;Initial Catalog=MARKETING;User ID=pank;Password=1234"); SqlCommand cmd =new SqlCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "FillMultiCombo"; cmd.Connection = cn; DataSet ds=new DataSet(); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(ds); da.Dispose(); cmd.Dispose(); cn.Close(); GridView1.DataSource = ds.Tables[0]; GridView1.DataBind(); GridView2.DataSource = ds.Tables[1]; GridView2.DataBind(); ds.Dispose(); Thanks.

    E 1 Reply Last reply
    0
    • V Vishal09

      Hi There, This Task I Had Done Using Below Code Where I Had Used Simple SQL Connection. Now I Want to do This with Linq to SQL.Can Any one Tell me How to Do This. string name=string.Empty; SqlConnection cn= new SqlConnection("Data Source=ASP4;Initial Catalog=MARKETING;User ID=pank;Password=1234"); SqlCommand cmd =new SqlCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "FillMultiCombo"; cmd.Connection = cn; DataSet ds=new DataSet(); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(ds); da.Dispose(); cmd.Dispose(); cn.Close(); GridView1.DataSource = ds.Tables[0]; GridView1.DataBind(); GridView2.DataSource = ds.Tables[1]; GridView2.DataBind(); ds.Dispose(); Thanks.

      E Offline
      E Offline
      Eslam Afifi
      wrote on last edited by
      #2

      LINQ to SQL and multiple result sets in Stored Procedures[^]

      Eslam Afifi

      A 1 Reply Last reply
      0
      • E Eslam Afifi

        LINQ to SQL and multiple result sets in Stored Procedures[^]

        Eslam Afifi

        A Offline
        A Offline
        ais07
        wrote on last edited by
        #3

        Thanks Eslam, I was also serching same thing.

        Life Is Beautifull

        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