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 6046273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:13:12+00:00 2026-05-23T07:13:12+00:00

I am designing a project in asp.net mvc3, i have designed my database in

  • 0

I am designing a project in asp.net mvc3, i have designed my database in sql server, add i am using ado.net.

This is my controller action

    public ViewResult ProductFormulationIndex()
    {

        return View(db.ProductFormulation.ToList());
    }

means i want to display all fields of ProductFormulation table.
this is my table:-
enter image description here

and this is my productCategory Table
enter image description here

in my ProductFormulationIndex.cshtml i want to display Code of ProductCategory Table, not only id. So what should i do in controller or in Model for it ?
you may suggest tutorial related to it.
Thanks 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-23T07:13:13+00:00Added an answer on May 23, 2026 at 7:13 am

    You need a view model which is specifically designed for the view.

    When defining your view models you shouldn’t be thinking in terms of tables. SQL tables have absolutely no meaning in a view. Think in terms of what information you need to show and define your view models accordingly.
    Therefore, You can define a view model like:

    public class ProductInformation
    {
    ...
    public string CategoryCode {get; set;}
    ...
    }  
    

    Or public Category ProductCategory.
    You can use AutoMapper to convert between your real models and the view model you have defined.

    You can find a good tutorial at http://weblogs.asp.net/shijuvarghese/archive/2010/02/01/view-model-pattern-and-automapper-in-asp-net-mvc-applications.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am designing a project in asp.net mvc3, i have designed database in sql
i am designing a project in asp.net mvc3. this is my table i want
I am designing a project on ASP.NET MVC 3. I am using this query
I have a asp.net project and Its in designing phase. Its about products and
i am designing a project in .net 4.0 using mvc3. my table name logindata
I am designing a project in asp.net 4.0, i am using MVC 3. I
I got a project of designing a Database. This is going to be my
I am designing a database for a project. I have a table that has
I have a dilemma with this, I am designing a project and basically it
I'm planing / designing my database for my current project (Java). For this project

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.