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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:27:11+00:00 2026-05-24T20:27:11+00:00

I am getting an error Error 826 Cannot implicitly convert type ‘System.Collections.Generic.IEnumerable’ to ‘OVR.Models.ChildInfoModel’.

  • 0

I am getting an error

Error 826 Cannot implicitly convert type ‘System.Collections.Generic.IEnumerable’ to ‘OVR.Models.ChildInfoModel’. An explicit conversion exists (are you missing a cast?) C:\dev…..\Controllers\NewRecordController.cs 129 34 OVR

    public ActionResult ChildInfo(ChildInfoModel childInfoModel)
    {
        //INewRecord newRecord = (INewRecord)TempData["newRecord"];

        if (TempData["CertNum"].ToString() == "")
        {
            return View();
        }
        else
        {
            string certNum = (string)TempData["CertNum"];

            //call up Child Info Screen
            var repo = new Get_Home_Repository();
            childInfoModel = repo.Get_Screen_DataDS(certNum, "ChildInfo");
            //childInfoModel = cModel;

            return View(childInfoModel);
        }

    }
  1. TempData[“CertNum”] contains the value I need
  2. The View is strongly typed to the model with @model OVR.Models.ChildInfoModel
  3. I added in the parameter (ChildInfoModel childInfoModel) but if a link is not clicked a blank page is to be pulled up and allowed to be filled out, otherwise I pass in the parameters needed to pull data from a repository which it then populates the interface IChildInfo of which contains the data from a list as IEnumerable. I figured I could somehow explicitly convert .. or that the Interface IChildInfo needs to get updated in order to pass back the model to the view. How do I get the model populated from the repository data?
  • 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-24T20:27:12+00:00Added an answer on May 24, 2026 at 8:27 pm

    What is Get_Screen_DataDS returning? Whats the method signature return? It seems you are returning IEnumerable from Get_Screen_DS – what is this an IEnumerable of?
    You are assigning to an instance of childInfoModel which I’m assuming is not an IEnumerable but I can’t really tell from what you have posted.

    Should you be returning an IEnumerable? If ChildInfoModel implements IEnumerable then just simply cast it

    childInfoModel = (ChildInfoModel) repo.Get_Screen_DataDS(certNum, “ChildInfo”);
    However in this case you should probably just hat Get_Screen_DataDS return type ChildInfoModel.

    Also, it will help you much in the long haul to stick to consistent and standard .net naming conventions.

    var repo would be var repository.
    GetScreenDataDS would be…. GetScreenData() or GetScreenDataByCert()
    FxCop rules can help you with this : ) Just my extra .00000002

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

Sidebar

Related Questions

I ma getting error like Cannot implicitly convert type 'string' to 'System.Web.UI.WebControls.Unit' in the
i am getting error: cannot convert to pointer type NSMutableDictonary *mydictonary; [mydictionary setValue: [mySlider.value
The error I'm getting: error C2664: 'v8::FunctionTemplate::New' : cannot convert parameter 1 from 'v8::Handle<T>
at the moment im loading xml and i am getting error: System.Xml.XmlException: ' ',
getting error: ActiveRecord::StatementInvalid (PGError: ERROR: argument of HAVING must be type boolean, not type
I'm getting error using the following code snippet jQuery(document).ready(function() { jQuery.ajax({ url: url, type:
I'm getting error C3095: 'Xunit::Extensions::InlineDataAttribute': attribute cannot be repeated in C++/CLI code but not
I am getting error c2440 in my compiler but I cannot figure out what
I am getting error ( JVM Error 545 incompatible or corrupt file system )
I am getting error to convert T to Entity public T Add(T entity) {

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.