Note that there are some explanatory texts on larger screens.

plurals
  1. POMVC3 ViewData Visual Basic Issue
    primarykey
    data
    text
    <p>Hello I am fairly new to visual basic and was wondering if someone could tell me what I'm doing wrong in the ViewData("FirstName") statement??</p> <pre><code>Public Class HomeController Inherits System.Web.Mvc.Controller Private db As cs_dev_ccmetrics_apps = New cs_dev_ccmetrics_apps Protected Overrides Sub OnActionExecuted(filterContext As ActionExecutedContext) 'APP INFO '-------------------------- ViewData("Version") = "0.1.7" ViewData("RevDate") = "08/20/2013" ViewData("FirstName") = Select name_first From users Where NT_id = System.Environment.UserName End Sub </code></pre> <p>I have the model set up like so:</p> <pre><code>Imports System Imports System.Collections.Generic Partial Public Class users Public Property id As Integer Public Property domain_id As Byte Public Property NT_id As String Public Property emp_id As Integer Public Property ssn As String Public Property pwd As String Public Property admin_role As Byte Public Property name_last As String Public Property name_first As String Public Property last_login As Nullable(Of Date) Public Property failed_attempts As Byte Public Property active As Boolean Public Property dt_updated As Date End Class </code></pre> <p>With a dbcontext setup like this:</p> <pre><code>Imports System Imports System.Data.Entity Imports System.Data.Entity.Infrastructure Partial Public Class cs_dev_ccmetrics_apps Inherits DbContext Public Sub New() MyBase.New("name=cs_dev_ccmetrics_apps") End Sub Protected Overrides Sub OnModelCreating(modelBuilder As DbModelBuilder) Throw New UnintentionalCodeFirstException() End Sub Public Property app_log() As DbSet(Of app_log) Public Property ref_AdminRole() As DbSet(Of ref_AdminRole) Public Property ref_apps() As DbSet(Of ref_apps) Public Property ref_domains() As DbSet(Of ref_domains) Public Property user_apps() As DbSet(Of user_apps) Public Property users() As DbSet(Of users) End Class </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload