Hi!
I've just started to explore NHibernate and got a problem wich I'm trying to solve for hours now... I want to create a very litte application which creates a db-entry and modifies the data afterwards:
Code:
Configuration cfg = new Configuration();
cfg.AddAssembly("HibernateSandbox");
ISessionFactory factory = cfg.BuildSessionFactory();
ISession session = factory.OpenSession();
ITransaction transaction = session.BeginTransaction();
User newUser = new User();
newUser.Id = "k3";
newUser.UserName = "Topper";
session.Save(newUser);
transaction.Commit();
session.Close();
session = factory.OpenSession()
[b]User joeCool = (User)session.Load(typeof(User), "k3");[/b]
joeCool.UserName = "otherName";
session.Flush();
The first parts works perfectly, bzt I'm not able to retrieve the values from the database. The "...session.load..." get's always a "No row with the given identifier exists" error. I as well tried to select data via the "session.CreateSQLQuery" but that didn't gave me any resukt either...
Thanks for any ideas what I'm doing wrong,
Martin[/code]