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

Related Questions

i am getting The object cannot be deleted because it was not found in
I am getting very frustrated because I cannot seem to figure out why Collections
We are getting this error after upgrading to NHibernate 2.1. [QueryException: Cannot simultaneously fetch
I am getting the following error message from a bulk load in sql server
hey guys, i'm getting an exception on the following inner exception: {Value cannot be
In one of our application im getting an exception that i can not seem
I getting the following error when I try to connect to my server app
Im getting frustrated because of OpenDNS and other services (ie: roadrunner) that now always
I'm getting an ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord,Intent) error each time I boot up my program in the
I'm getting this error when I deploy a VB.NET application and for the life

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.