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. Stored procedure with JOIN result and LINQ

Stored procedure with JOIN result and LINQ

Scheduled Pinned Locked Moved LINQ
databasecsharphelpsql-servervisual-studio
1 Posts 1 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.
  • A Offline
    A Offline
    Aftab Sindhi
    wrote on last edited by
    #1

    I am using stored procedure, which returns the records from two tables by INNER JOIN. In Visual Studion 2008, using ORM I dragged the stored procedure from Server Explorer. Inside the aspx page I am using ObjectDataSource with type name of datacontext and select method of stored procedure. I bound the Repeater control to object data source and everything is working fine. Results are coming and displayed properly. I ran into problem, when I tried to display the contents of one column <%# Eval("DetailPage")%>, which belongs to the 2nd table of JOIN (Sections) inside the stored procedure. The exception DataBinding: 'storedprocedurename' does not contain a property with the name 'DetailPage' while all other columns from 1st table(Articles) in join are accessable. Logically, its not matter of LINQ to know from where data is retrieved; i.e. from single table or multiple tables, because LINQ is calling stored procedure. If completly no record is returned, then can be said may be there is something missing and records are not returned. Records are coming, just a few columns are missing!! how come? I tried to execute the same stored procedure in Sql Server by passing exact parameters and same records are displayed with columns including other joined table. values also exist in these columns, then where is the problem? Following is the stored procedure's query SELECT Articles.ID, Articles.SectionID, Articles.Title, Articles.Contents, Articles.Author, Sections.HomePage, Sections.DetailPage,ROW_NUMBER() OVER (ORDER BY Articles.Sequence DESC) AS SNo FROM Articles INNER JOIN Sections ON Articles.SectionID=Sections.ID WHERE Articles.SectionID=11 All columns from Articles table are accessable but no one column from Sections table accessable. Try to access in repeater control throws the exception mentioned above. Does anyone can figure what and where is the problem ? Environment --------------- Sql Server 2005 VS 2008 RTM .NET 3.5 I need URGENT help.

    Regards Aftab Sindhi .NET Application Developer U.A.E

    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