我现在做了个小东东代码都写好了,运行都通过了,为什么数据不能存入数据库中,是不是save函数不能存数据到数据库的????
代码如下:
   Configuration cfg = new Configuration();
   cfg.AddAssembly("MyNhibernate");
   cfg.AddXmlFile ("F:\\jinqi\\MyNhibernate\\User.hbm.xml");
   MyUser newUser =new MyUser();
   newUser.Id = "joe_cool";
   newUser.UserName = "Joseph Cool";
   newUser.Password = "abc123";
   newUser.EmailAddress = "joe@cool.com";
   ISession session= cfg.BuildSessionFactory().OpenSession();
   session.Save (newUser);
   session.Close ();

相关文章:

  • 2022-12-23
  • 2022-01-25
  • 2021-08-23
  • 2022-01-24
  • 2021-07-10
  • 2021-09-30
  • 2021-06-21
  • 2021-08-09
猜你喜欢
  • 2022-12-23
  • 2021-07-22
  • 2021-07-29
  • 2021-12-14
  • 2021-07-26
  • 2021-07-27
  • 2022-12-23
相关资源
相似解决方案