• (2 Pages)
  • +
  • 1
  • 2

Fluent NHibernate tutorial Simple ORM application

#16 Guest_HopeToBelieveIn*


Reputation:

Posted 06 January 2011 - 12:22 PM

ah Ok. Now its allright.
Thank you again)
Was This Post Helpful? 1

#17 franco148J  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 20-July 11

Posted 21 July 2011 - 07:08 AM

View PostFlashM, on 06 January 2011 - 01:56 AM, said:

This was a quick fix of your solution that you sent to my mail account:

OK, this was just a quick check of your solution and I kind of fixed it...

In your BuildSessionFactory method I updated this line of code from this:

.Database(PostgreSQLConfiguration.Standard

into this:

.Database(PostgreSQLConfiguration.PostgreSQL82

Then I also added Mono.Security.dll reference to the project and everything worked as it should.
Remember to create an empty database with assigned user in PostgreSQL first.

Let me know if this worked for you as well.

best regards,
Kecman Ales



Hi FlashM

apology but performing the steps mentioned in the tutorial, even I have problems with the sample application. Please could you help me with this? using both database engines I have the following issue that was attached in the image file.

thanks for your help.

Attached image(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -

#18 simaodinho  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 07-September 11

Posted 07 September 2011 - 03:11 AM

Hi
i try the steps you give in this tutorial,but i have the same problem as franco148J.
any help
Was This Post Helpful? 0
  • +
  • -

#19 cclements1384  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 14-March 12

Posted 14 March 2012 - 09:04 PM

I also seem to have the same issue as the last two posters.
The text of the issue exception states that the FluentNHibernate.dll] Signature is incorrect.

I am using the latest version of FluentNhibernate.dll (1.2).

Any help is greatly appreciated.

Chris
Was This Post Helpful? 0
  • +
  • -

#20 12avi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 20-April 12

Posted 20 April 2012 - 03:32 PM

Hi,

Thank you for this tutorial. I tried completing this and got the following exception.
"FluentNHibernate.Cfg.FluentConfigurationException was unhandled" and I cannot figure out why it's not connecting to my new empty DB.

The code which causes the exception is shown below
         
private static ISessionFactory BuildSessionFactory()
        {
            AutoPersistenceModel model = CreateMappings();

            return Fluently.Configure()
                .Database(MsSqlConfiguration.MsSql2008
                .ConnectionString(c => c
                    .Server("Ravi-PC")
                    .Database("NHibernateTestDB")
                    .Username(@"Ravi-PC\Ravi")
                    .Password("")
                    ))
                .Mappings(m => m
                    .AutoMappings.Add(model))
                .ExposeConfiguration(BuildSchema)
                .BuildSessionFactory();
        }



When I try and connect to the DB directly through VS2010, I have no problems. I have tried to match the connection settings, but still can't get it to work.

In VS2010, the connection string to the DB is :
Data Source=Ravi-PC;Initial Catalog=NHibernateTestDB;Integrated Security=True

Sorry if this is a basic question, I'm a newbie so still have a steep learning curve.

Thanks,
Ravi
Was This Post Helpful? 0
  • +
  • -

#21 mztanvir  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 15-May 12

Posted 15 May 2012 - 11:43 PM

Thanks for such a nice and comprehensive tutorial...
It works very correctly... :)
Was This Post Helpful? 0
  • +
  • -

#22 quanghai  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 14-October 12

Posted 14 October 2012 - 08:37 PM

Hi FlashM,
The guide is so good,
but when I add more class
namespace WindowsFormsApplication1.Model
{
    public class Sex
    {
        public virtual int SexID { get; set; }
        public virtual string SexName { get; set; }
    }
}



class employee was adjusted as follow
namespace WindowsFormsApplication1.Model
{
   public class Employee
    { 
        public virtual int Id { get; set; }
        public virtual string FirstName { get; set; }
        public virtual string LastName { get; set; }
        public virtual string Address { get; set; }
        public virtual Post Post { get; set; }
        public virtual DateTime DateEmployed { get; set; }
        public virtual Sex Sex { get; set; }
      
    }
}


Before running this sample, I delete all table on but the error appear at function

private static ISessionFactory BuildSessionFactory()
        {
            AutoPersistenceModel model = CreateMappings();

            return Fluently.Configure()
                .Database(MsSqlConfiguration.MsSql2008
                .ConnectionString(c => c
                    .Server("SSGSERVER\\SQLEXPRESS")
                    .Database("ORMTest")
                    .Username("sa")
                    .Password("sa")))
                .Mappings(m => m
                    .AutoMappings.Add(model))
                .ExposeConfiguration(BuildSchema)
                .BuildSessionFactory();
        }



Please help me to fix it
Thankyou very much indeed
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2