为什么数据集设计器要更改我的架构对象的大小写?

发布于 2024-12-17 18:23:45 字数 317 浏览 3 评论 0原文

我有两个具有相同架构的 xsd 文件。第一个是从 SQL 连接生成的,另一个是由数据集设计器从 FoxPro OleDb 连接生成的。我无法使用相同的 XSD 来生成表适配器和表,因为 SQL 和 OleDb 提供程序生成不同的类型。我无法使用 EF,因为它不支持 FoxPro OleDb,或者至少不正式支持。

我还遇到这样的问题:SQL xsd 文件的表、字段和表适配器名称为大写,而 FoxPro OleDb 连接为小写。这造成了我无法从基本类型中欺骗它们的情况。

对于这个问题是否有合适的解决方法,或者我的 DAL 层中是否必须有两组代码?我不想为所有这些表重写 CRUD 操作。

I have two xsd files with the same exact schema. The first was generated from an SQL connection and the other was generated from a FoxPro OleDb connection by the Dataset Designer. I can't use the same XSD for generating my table adapters and tables because of SQL and OleDb providers generates different types. I can't use EF because it doesn't support FoxPro OleDb, or at least not officially.

I also have the problem where the SQL xsd file has table, field, and table adapter names in UPPERCASE and the FoxPro OleDb connection in lowercase. This creates a situation where I can't trick into casting them from a base type.

Is there a suitable work-around for this problem or do I have to have two sets of code in my DAL layer? I would hate to have to rewrite CRUD operations for all these tables.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

静谧幽蓝 2024-12-24 18:23:45

为了澄清一下,您是否连接到两个“服务器”来获取数据?您是否正在尝试将数据从一台服务器复制到另一台服务器?您始终可以使用相同的列名称和可比较的数据类型(文本与字符、整数、备忘录与 blob 等)对每个结果进行查询。

我实际上已经编写了一个基于 INTERFACE 类型的数据查询包装对象,以便为每个数据库连接执行一次查询和更新,然后为相应的单个表进行子类化,因此大多数繁重的工作只需完成一次。

根据接口,我指的是 IDbConnection(SQLConnection 与 OleDbConnection)、IDbCommand(SQLCommand 与 OleDbCommand)等的接口,并且对于我连接到 SQL、MySQL、Access、SQLite 和 Visual Foxpro 数据库非常有效。

话虽如此,您正在使用 XSD 文件做什么/如何使用。如果再澄清一点,我也许可以提供更多帮助。

For clarification, are you connecting to BOTH "servers" for data? Are you trying to copy data from one server to another? You could always have your query from each result in same column names and comparable data types (text vs char, integer works in both, memo vs blob, etc).

I've actually written a data querying wrapper object based on the INTERFACE types to perform querying and updating once per database connection, then subclassing from that for the respective individual table, so most of all the grunt work is done once.

As per the interfaces, I'm referring to that of IDbConnection (SQLConnection vs OleDbConnection), IDbCommand (SQLCommand vs OleDbCommand), etc and has worked well for me connecting to SQL, MySQL, Access, SQLite and Visual Foxpro databases.

All that being said, what/how are you using your XSD files. With a little more clarification, I might be able to offer a little more help.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文