Bagaimana caranya Menampilkan data dari LINQ menggunakan MVC

Last post 02-22-2010 8:25 by supraptin. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 02-08-2010 22:14

    • supraptin
    • Top 500 Contributor
    • Joined on 01-19-2010
    • Posts 7
    • Points 110

    Bagaimana caranya Menampilkan data dari LINQ menggunakan MVC

    Saya sudah coba, sesuai dengan yang di artikel. Tp kok tetep error ya..

     Apakah harus ada yg saya tambahkan di web.config atau apa?

    pada saat akses halaman biasa tidak masalah, tp sewaktu mengakses halaman yang memuat data melalui LINQ kok error ya..

    erronya seperti ini :

     

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.InvalidOperationException: The model item passed into the dictionary is of type 'System.Data.Linq.DataQuery`1[NAMA_PROJECT.Models.NamaTabel]' but this dictionary requires a model item of type 'NAMA_PROJECT.Models.NamaTabel'.

    Padahal saya sudah membuat modelnya menggunakan LINQ class. Juga saya telah membuat "Repository Pattern"nya..

    Mohon bantuanya. Karena saya sudah mencoba berulang2, bahkan membuat Project barupun, saya mengalami masalah yang sama.

     

    Tx.

     

     

     

    • Post Points: 20
  • 02-10-2010 14:14 In reply to

    Re: Bagaimana caranya Menampilkan data dari LINQ menggunakan MVC

    Mungkin bisa dicoba dishare kode yang bermasalah tersebut.
    Ferry Meidianto
    My Site :: My Blog @ INDC
    • Post Points: 20
  • 02-20-2010 15:42 In reply to

    • supraptin
    • Top 500 Contributor
    • Joined on 01-19-2010
    • Posts 7
    • Points 110

    Re: Bagaimana caranya Menampilkan data dari LINQ menggunakan MVC

    Saya Telah Menemukan error Ini :

     

    Compilation Error
    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

    Compiler Error Message: CS0234: The type or namespace name 'MstPegawai' does not exist in the namespace 'SUPRAPTIN.Models' (are you missing an assembly reference?)

    Source Error:

     

    [No relevant source lines]
     

    Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\1e2172b2\9802d475\App_Web_pegawai.aspx.a8d08dba.pz-0je22.0.cs    Line: 152

    • Post Points: 20
  • 02-21-2010 11:00 In reply to

    Re: Bagaimana caranya Menampilkan data dari LINQ menggunakan MVC

    Coba cek lagi reference ke MstPegawai dimana terjadi errror tersebut.
    Bisa jadi Anda belum mengimport reference ketika menggunakan class tersebut di View (jikalau error ini terjadi di View).
    Ferry Meidianto
    My Site :: My Blog @ INDC
    • Post Points: 20
  • 02-22-2010 8:25 In reply to

    • supraptin
    • Top 500 Contributor
    • Joined on 01-19-2010
    • Posts 7
    • Points 110

    Re: Bagaimana caranya Menampilkan data dari LINQ menggunakan MVC

     Maf Pak.Ferry,,, sy benar2 newbie..

    klo boleh saya tanya "Reference" itu apa ya?

    Dan cara import nya gmn ya?

    Tx..

    • Post Points: 5
Page 1 of 1 (5 items)
Microsoft Internet Explorer 8

Anda tampaknya menggunakan . Jelajahi website dengan cepat dan aman dengan Internet Explorer 8