NHibernate配置要连接到Visual FoxPro 8.0吗? [英] NHibernate configuration to connect to Visual FoxPro 8.0?

查看:87
本文介绍了NHibernate配置要连接到Visual FoxPro 8.0吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好奇是否有人将NHibernate连接到Visual Foxpro 8.0?我希望使用旧的数据存储,并且宁愿使用NHibernate,而不必手工编写所有ADO.Net.

Curious if anyone out there has ever connected NHibernate to Visual Foxpro 8.0? I'm looking to hook into a legacy data store, and would prefer to use NHibernate vs. having to hand-code all of the ADO.Net.

如果任何人都有FoxPro 8连接的配置XML文件示例,那就太好了!

If anyone has an example of the configuration XML file for a FoxPro 8 connection that would be great!

推荐答案

并找出解决方案:

首先,我需要拾起 Visual FoxPro驱动程序(这些是9.0,但允许我在8.0中工作).

First, I needed to pick up the Visual FoxPro drivers (these are 9.0 but allowed me to work in 8.0).

接下来,我必须按如下所示设置NHibernate配置.在此项目中,我基于目录,因此我有一个名为C:\ Temp \ VisualFox \的目录,其中包含我的所有* .dbf文件.

Next, I had to set up my NHibernate config as follows. In this project I'm directory based, so I have a directory called C:\Temp\VisualFox\ that contains all of my *.dbf files.

  <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
    <reflection-optimizer use="false" />
    <session-factory>
      <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
      <property name="dialect">NHibernate.Dialect.GenericDialect</property>
      <property name="connection.driver_class">NHibernate.Driver.OleDbDriver</property>
      <property name="connection.connection_string">Provider=VFPOLEDB;Data Source=C:\Temp\VisualFox;Collating Sequence=general</property>
      <property name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>
      <property name="show_sql">false</property>
    </session-factory>
  </hibernate-configuration>

现在,世界上一切都很好!

And now, all is well in the world!

这篇关于NHibernate配置要连接到Visual FoxPro 8.0吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆