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

查看:24
本文介绍了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:TempVisualFox 的目录,其中包含我所有的 *.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:TempVisualFox 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:TempVisualFox;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天全站免登陆