What does "invalid object name" mean? Is there documentation on that error?

What does "invalid object name" mean? Is there documentation on that error?

rdmrdm Posts: 194Questions: 55Answers: 4

I'm working on a new Editor page in .NET MVC when this error pops up. When I go into the Network > XHR panel I see this.

error: "Invalid object name 'CohortLatestEnrollmentRecord'."

The one forum post related to this error in PHP, which I don't know. Is there a reference that indicates what "invalid object name" means and how to resolve it?

This question has an accepted answers - jump to answer

Answers

  • rdmrdm Posts: 194Questions: 55Answers: 4

    I figured out in my case, I had to pluralize the model name. While the model in both the database and in the MVC model is in singular form, the MVC standard is to pluralize names. Gets me every time.

    But my original question still remains: is there documentation on the error "Invalid object name"?

    var response = new Editor(db, "CohortLatestEnrollmentRecords", "Id")

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    In this case, the error is thrown from the database end. We can't reasonably expect DataTables to document errors which may be thrown elsewhere than from DataTables itself.

  • rdmrdm Posts: 194Questions: 55Answers: 4

    @tangerine -- Are you saying that the error type "invalid object name" does not exist in the DataTables or Editor error handling code? That the error message is passed through from SQL Server?

  • allanallan Posts: 63,512Questions: 1Answers: 10,472 Site admin
    Answer ✓

    What should be happening, is that the server would return JSON in the form:

    { "error": "Invalid object name 'CohortLatestEnrollmentRecord'." }
    

    DataTables would then display that error as an alert (assuming you are using ajax to get the JSON data).

    The error message text is generated by the SQL server, and Editor doesn't attempt to interpret that at all - it will just return the text given to it.

    Allan

This discussion has been closed.