}
}
//这段代码去老是提示:Could not execute query
private void Button2_Click(object sender, System.EventArgs e)
{
NHibernate.Cfg.Configuration c = new NHibernate.Cfg.Configuration();
c.AddXmlFile(System.Web.HttpContext.Current.Server.MapPath("Customers.xml"));
c.AddXmlFile(System.Web.HttpContext.Current.Server.MapPath("Orders.xml"));
c.AddXmlFile(System.Web.HttpContext.Current.Server.MapPath("Shippers.xml"));
ISession vSession= c.BuildSessionFactory().OpenSession();
ITransaction vTransaction = vSession.BeginTransaction();
try
{
IList data = vSession.Find("from Customers");
DataGrid1.DataSource = data;
DataGrid1.DataBind();
vTransaction.Commit();
}
catch(Exception ex)
{
vTransaction.Rollback();
Response.Write(ex.Message);
}
finally
{
vSession.Close();
}
}
我测试来测试去,都是觉得是
<set name="Orders" >
<key column="CustomerID" />
<one-to-many class="RG.SuperStarOA.Orders.Data.Orders,WebApplication1" />
</set>
或者,写查询语句有问题?
谁能解决,拜托~`
上一篇: Visual Basic串口通讯调试方法
下一篇: WebLogic管理最佳实践
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!



