asp.net mvc - How to display invoice details in Details View from invoice header -


i have 2 tables: invoice_header (pk: org_number, supplier_number, invoice_number) , invoice_line (pk: org_number, supplier_number, invoice_number, seq). index view displays records invoice_header. trying details view display corresponding records invoice_line table.

i'm receiving error: "the number of primary key values passed must match number of primary key values defined on entity. parameter name: keyvalues"

the error here: controller

and here relevant section index view: index view

i suspect need have "seq" column part of composite pk on invoice_line. want see records match on org_number, supplier_number , invoice_number, regardless of seq.

if you're using entity framework, suspect are, find wrong method. find searching primary keys , require feed in values of composite key. in case believe method want where. allow search via values instead of finding key.

keep in mind not hit pk index , can have performance issues. you'll want testing. can check out link below see comparison of query types ef.

http://msdn.microsoft.com/en-us/data/jj573936.aspx


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -