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

  • Home
  • SEARCH
  • 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 584255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:52:43+00:00 2026-05-13T14:52:43+00:00

I am getting a cannot load entity error because of {Incorrect syntax near the

  • 0

I am getting a cannot load entity error because of {“Incorrect syntax near the keyword ‘File’.”}

Here is my mapping file. I’m assuming I am not escaping something properly but I don’t see what. I don’t think it’s my PreApplication.File table name. Thanks in advance!!

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Model" namespace="Model.PreApplication">
  <class name="File" table="PreApplication.File">

    <id name="ID" column="ID" type="Int32" unsaved-value="0">
      <generator class="native" />
    </id>

    <property name="DateUploaded" column="DateUploaded" type="DateTime" not-null="true" />
    <property name="FileName" column="`FileName`" type="String" not-null="true" />
    <property name="OriginalFileName" column="OriginalFileName" type="String" not-null="true" />
    <property name="ContentType" column="ContentType" type="String" not-null="true" />

  </class>
</hibernate-mapping>

Edit:
Using the suggestions provided, I’ve discovered that they problem is being caused by my table being called File. If I change the table attribute to “PreApplication.[File]” it works correctly, but I don’t think that’s the “NHibernate” way of doing it. I think I’m supposed to use the tick character (`) but I can’t seem to make that work.

  • 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-13T14:52:43+00:00Added an answer on May 13, 2026 at 2:52 pm

    I’ve found the correct way of fixing this. I found the schema attribute and have changed it as follows:

    <class name="File" schema="PreApplication" table="`File`">
    

    This properly escapes the File table name without having to hardcode []. Thanks for the help everyone!

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

Sidebar

Ask A Question

Stats

  • Questions 302k
  • Answers 302k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Generally speaking, no: log entries are stored as so-called "Revision… May 13, 2026 at 8:25 pm
  • Editorial Team
    Editorial Team added an answer The only way in which std::stack is significantly slower than… May 13, 2026 at 8:25 pm
  • Editorial Team
    Editorial Team added an answer I'm no expert on this but I believe what you… May 13, 2026 at 8:25 pm

Related Questions

I am trying to test that the business rule of not allowing to share
I am trying to get my development environment up and running, and I am
UPDATE 3: I created a Visual Studio 2008 test project and tried to create
after some advice regarding a problem i am getting using a linux based piece
I am trying to perform a bulk insert onto SQL Server: BULK INSERT SampleData

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.