我想问一下NHibernate的问题???
我现在做了个小东东代码都写好了,运行都通过了,为什么数据不能存入数据库中,是不是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 ();
代码如下:
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 ();
posted on 2004-10-08 15:47 surprise 阅读(3589) 评论(18) 编辑 收藏 举报