title: NHibernate GenericAdoException was unhandled could not execute query
body: <p>I have an exception "GenericAdoException was unhandled" could not execute query while i was trying to do the nhibernate example on this line:</p>
  
  <pre><code>var users = session.CreateCriteria&lt;User&gt;().List&lt;User&gt;();
  </code></pre>
  
  <p>Inner exception is: incorrect syntax near 'User'</p>
  
  <p>My Main method on Program.cs:</p>
  
  <pre><code>using NHibernate.Cfg;
  using NHibernate.Dialect;
  using NHibernate.Driver;
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Reflection;
  using System.Text;
  using System.Threading.Tasks;
  
  namespace ConsoleApplication2
  {
      class Program
      {
          static void Main(string[] args)
          {
              var cfg = new Configuration();
              cfg.DataBaseIntegration(x =&gt;
              {
                  x.ConnectionString = "Server=.;database=NHibernateTryOutDB;uid=sa;pwd=Hasar2012";
                  x.Driver&lt;SqlClientDriver&gt;();
                  x.Dialect&lt;MsSql2012Dialect&gt;();
              });
              cfg.AddAssembly(Assembly.GetExecutingAssembly());
              var sessionFactory = cfg.BuildSessionFactory();
              using (var session = sessionFactory.OpenSession())
              using (var tx = session.BeginTransaction())
              {
                  var users = session.CreateCriteria&lt;User&gt;().List&lt;User&gt;();
                  foreach (User item in users)
                  {
                      Console.WriteLine("{0} {1}", item.Name, item.Surname);
                  }
                  tx.Commit();
              }
              Console.WriteLine("Press &lt;Enter&gt; to exit...");
              Console.ReadLine();
          }
      }
  }
  </code></pre>
  
  <p>I ve a table named Users:</p>
  
  <pre><code>USE [NHibernateTryOutDB]
  GO
  
  /****** Object:  Table [dbo].[Users]    Script Date: 12/10/2013 16:04:12 ******/
  SET ANSI_NULLS ON
  GO
  
  SET QUOTED_IDENTIFIER ON
  GO
  
  CREATE TABLE [dbo].[Users](
      [ID] [int] IDENTITY(1,1) NOT NULL,
      [Name] [nvarchar](50) NULL,
      [Surname] [nvarchar](50) NULL,
   CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED 
  (
      [ID] ASC
  )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
  ) ON [PRIMARY]
  
  GO
  </code></pre>
  
  <p>My class names User.cs:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  
  namespace ConsoleApplication2
  {
      class User
      {
          public virtual int ID { get; set; }
          public virtual string Name { get; set; }
          public virtual string Surname { get; set; }
      }
  }
  </code></pre>
  
  <p>My .hbm.xm file that is User.hbm.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                     assembly="ConsoleApplication2"
                     namespace="ConsoleApplication2"&gt;
    &lt;class name="User"&gt;
      &lt;id name="ID"&gt;
        &lt;generator class="native"/&gt;
      &lt;/id&gt;
      &lt;property name="Name"/&gt;
      &lt;property name="Surname"/&gt;
    &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>How can i solve this issue?</p>