Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3961570
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:59:27+00:00 2026-05-20T02:59:27+00:00

i need to access data from a table and from a view on a

  • 0

i need to access data from a table and from a view on a particular page, so i made a class that can access them both. looks like this `

namespace LoanManager.Models
{
    public class Loan_vwFieldValues
    {
        public Loan loan { get; set; }
        public VW_FIELD_VALUE vwFieldValues { get; set; }

    }
}

at the top of my page i have this

<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" Inherits="System.Web.Mvc.ViewPage<IEnumerable<LoanManager.Models.Loan_vwFieldValues>>" %>

then i have this my controller after some other other code that works.

return View(_db.LOAN_VWFIELDVALESs.Where(predicate));

and my definition for that looks like this.

public System.Data.Linq.Table<Loan_vwFieldValues> LOAN_VWFIELDVALESs
        {
            get
            {
                return this.GetTable<Loan_vwFieldValues>();
            }
        }

this works fine for all the rest of my pages (they have different names of course), but they are not a class, they just reference one table or a view i have made, but this page needs to access a table and a view, but it complains when it gets to this last part of posted code(return statement) and says that Loan_vwFieldValues is not mapped as a table, which is true because it is NOT a table,
i also have this to fill the Loan_vwFieldValues

public ActionResult LoanProperties(int id)
    {
        Loan_vwFieldValues l = new Loan_vwFieldValues();

        l.loan = (from a in _db.Loans where a.LOAN_ID == id select a).First();
        l.vwFieldValues = (from v in _db.VW_FIELD_VALUEs where v.Loan_ID == id select v).First();

        return View(l);

    }

but how can i get this to work with my class?
thank you in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T02:59:28+00:00Added an answer on May 20, 2026 at 2:59 am

    You need to create a collection of Loan_vwFieldValues and return that. We don’t have enough information to tell you how to construct those objects from your data access layer.

    In other words…

    return View(_db.LOAN_VWFIELDVALESs.Where(predicate).Select(
      x => new Loan_vwFieldValues()
      {
         loan = yourCodeHere,
         vwFieldValues = moreOfYourCodeHere
      })); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app based on a tab bar and data retrieved from the
I need to sync the data of a ms-sql 2005 & 2008 server to
I have a table called People with a columns of datatype xml called properties
I have a database with this table: Customer - ID - Phone - Cell
at our office we take daily backup of ASP.net application ms access backend for
I have 2 million rows in a flat db4o table. A lot of the
I am pretty new to this so sorry for my lack of knowledge. I
I've added the following image to help illustrate the problem better: Hi, I'm looking
I am currently working on a project with the final aim of converting a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.