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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:33:45+00:00 2026-06-12T07:33:45+00:00

This is my controller action: <EmployeeAuthorize()> Function HRA_Table() As ActionResult ‘ get current employee’s

  • 0

This is my controller action:

<EmployeeAuthorize()>
Function HRA_Table() As ActionResult

    ' get current employee's id
    Dim db1 As EmployeeDbContext = New EmployeeDbContext
    Dim user1 = db1.Tbl_Employees.Where(Function(e) e.Employee_EmailAddress = User.Identity.Name).Single()
    Dim empId = user1.Employee_ID
    Dim empSSN = user1.Employee_SSN

    Dim hra = db.Tbl_HRAs.Where(Function(x) x.SSN = empSSN)

    Return View(hra.ToList)

End Function

This is my model:

Public Class Tbl_HRA

    <Key()> Public Property HRA_ID() As Integer
    Public Property SSN() As String
    Public Property Height() As Double
    Public Property Weight() As Double
    Public Property Nic_EE() As String
    Public Property Nic_SP() As String
    Public Property BMI() As Double
    Public Property BP_S() As Double
    Public Property BP_D() As Double
    Public Property HDL() As Double
    Public Property LDL() As Double
    Public Property Tot_Chol() As Double
    Public Property Continine() As String
    Public Property Glucose() As Double
    Public Property Waist() As Double
    Public Property Hip() As Double
    Public Property Triglycerides() As Double
    Public Property A1C() As Double
    Public Property LDL_HDL() As Double

End Class

This is my view:

@ModelType IEnumerable(Of GemcoBlog.Tbl_HRA)

@Code
    Layout = Nothing
End Code

@For Each item In Model

    @item.Height

Next

The error I get is:

The ‘Height’ property on ‘Tbl_HRA’ could not be set to a ‘String’
value. You must set this property to a non-null value of type
‘Double’.

I can’t seem to understand why this error is occurring. I tried changing it to double based on some articles I read, but still it won’t work!

Thanks for your help.

  • 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-06-12T07:33:46+00:00Added an answer on June 12, 2026 at 7:33 am

    From your comment, it appears that the column in the table is a varchar. As a result, your model must define it as a string. Try changing the height property to be as follows:

     Public Property Height() As String
    

    Unfortunately, you can’t do type conversions directly in the LINQ to SQL implementation. If you want, you could project into another type (in the Select clause), but you would still need the immediate fetch (context.GetTable(Of T)) to have the types be equivalent between your database and the model.

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

Sidebar

Related Questions

What's wrong with this function: function() { $.get('/controller/action', function(data) { $('#temporaryPhotos').text(data); } ); return
This is what my controller action looks like [HttpPost] [OutputCache(Location = OutputCacheLocation.None)] public ActionResult
I have controller users . In this controller I have action account which is
If your controller action looks like this: respond_to do |format| format.html { raise 'Unsupported'
I have a controller action that checks this.User.Identity.IsAuthenticated What do you suggest how to
Consider this MapRoute: MapRoute( ResultFormat, {controller}/{action}/{id}.{resultFormat}, new { controller = Home, action = Index,
This is working, but how??? I have a controller action for a post: [AcceptVerbs(HttpVerbs.Post
in this tutorial of Yii framework http://www.yiiframework.com/doc/guide/1.1/en/basics.controller#action i want to put my Actions from
I have a controller with a action similar to this class EventsController < ApplicationController
I need to know how to test this controller action def create_mobile if mobile_user

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.