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

  • SEARCH
  • Home
  • 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 6016481
In Process

The Archive Base Latest Questions

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

I’m trying to learn ASP.NET MVC 3 with razor and so far getting the

  • 0

I’m trying to learn ASP.NET MVC 3 with razor and so far getting the hang of it.

one thing I’m stuck on is trying to getting multiple data calls to work.

a background to what I’m doing. I have a page that will show info about a project(which i got working) but i also want to show the progress of that project(which is another data call). I can’t get the progress data to show. i tried using viewbag, but got:

System.Data.Objects.ObjectResult`1[System.String]

I’m using stored procedures with the Entity Framework.

I appreciate the help guys.

EDIT:

Here is a rough example of my problem:

private SDMPREntities _db = new SDMPREntities();
public ActionResult Details(int id) { 
ViewData.Model = _db.ViewProjectDetails(id).ToList();
ViewBag.Progress = _db.ProjectProgress();
return View();
} 

EDIT2:

@James D’Angelo, yes in the view. Heres the razor code:

@model IEnumerable<DeveloperManagerSharp.Models.Projects>

@{
ViewBag.Title = "Project Details";
Layout = "~/Views/Shared/project-ui.cshtml";
}

<div class="post">
<h3 class="title">
    Project Details</h3>
<div class="entry">
    <h4>
        Select a Project</h4>
    <p>
        Select a project below to see their progress or to update any of their properties.</p>
</div>
</div>

@foreach (var item in ViewData.Model)
{    
<div class="post">
    <h3 class="title">@item.project_name (@item.project_version) @ViewBag.Progress%</h3>
    <div class="meta">
        <div class="posted">
            @Html.ActionLink("Edit", "Edit", new { id = item.PID }) |
            @Html.ActionLink("Back to Projects", "Index")
        </div>
        @if (@item.project_completed == "1") {
            <div class="date">
                Project is Completed.
            </div>
            } else {
            <div class="date">
                Project is Under Work.
            </div>       
            }
    </div>
    <div class="entry">
        @if(@item.project_status == "0")
            {
            <span>Status: Planning</span><br />
            }
            else if(@item.project_status == "1")
            {
            <span>Status: Alpha</span><br />
            }
            else if(@item.project_status == "2")
            {
            <span>Status: Beta</span><br />
            }
            else if(@item.project_status == "3")
            {
            <span>Status: Release Candiate</span><br />
            }
            else if(@item.project_status == "4")
            {
            <span>Status: Active</span><br />
            }
            else if(@item.project_status == "5")
            {
            <span>Status: Maure</span><br />
            }
            else if(@item.project_status == "6")
            {
            <span>Status: Discontinued</span><br />
            }
        Starts: @item.project_sdate<br />
        Ends: @item.project_edate<br />
        <em>@item.project_desc</em>
    </div>
</div>
}
  • 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-23T02:59:20+00:00Added an answer on May 23, 2026 at 2:59 am

    The call

    _db.ProjectProgress();
    

    Is most likely returning an ObjectResult, which represents a collection of items.

    So when you tried to display it in the view with

    @ViewBag.Progress
    

    ToString() is being called, which simply prints out the type.

    To get around this, you want to fetch a specific result from the set. Without knowing your data structure I can only hazard a guess, e.g.

    _db.ProjectProgress().Single(p=>p.ProjectId == id)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm parsing an XML file, the creators of it stuck in a bunch social
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a text area in my form which accepts all possible characters from
I am writing an app with both english and french support. The app requests
I am using Paperclip to handle profile photo uploads in my app. They upload

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.