使用 C# ADO.net 的 ODBC 到 SQL 数据库

发布于 2024-09-15 12:37:37 字数 123 浏览 4 评论 0原文

我有 MYOB(会计软件)数据库,我可以使用 ODBC 读取该数据库。现在我有包含 MYOB 数据库所有表的数据集。

我可以将此数据集转换为 SQL 数据库的最佳方法是什么?所有表都是自动创建的,数据也是自动插入的。

I have MYOB (AccountingSoftware) Database which I can read using ODBC. Now I have dataset containing all tables of MYOB database.

What is best way that I can convert this Dataset into SQL Database. Where all tables are created automatically and data inserted automatically.

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

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

发布评论

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

评论(2

蓝梦月影 2024-09-22 12:37:37

ODBC 只是这里涉及的一项技术。您计划使用什么工具以及要将数据放入哪个数据库?在我们知道您想要使用什么来执行此操作之前,我们无法提供答案。或者,如果您需要技术建议,请说清楚。

ODBC is only one technology involved here. What tool do you plan to use and what database do you want to put the data into? We can't provide an answer until we know what you want to use to do this. Or if you are asking for a technology recommendation, please make that clear.

懵少女 2024-09-22 12:37:37

在这种情况下我通常使用链接服务器。添加到 SQL 服务器的 ODBC 连接。然后您可以使用所有精美的 .net,例如 LINQ 和绑定。当我需要回写时,我将打开 ODBC 连接并将我的代码转换为他们的 odbc。

--CONNECT
EXEC sp_addlinkedserver
@server = 'MYOB',
@srvproduct = '',
@provider = 'MSDASQL',
@datasrc = 'YOUR_DSN'
GO

--List all tables:
EXEC sp_tables_ex @table_server = 'MYOB'

--Select from a Linked table:
SELECT * FROM OPENQUERY(MYOB, 'SELECT * FROM arcust')

I usually use a Linked Server in this situation. Add the ODBC connection to the SQL server. Then you can use all the fancy .net like LINQ and binding. When I'm required to write back I'll open and ODBC connection and translate my code to their odbc.

--CONNECT
EXEC sp_addlinkedserver
@server = 'MYOB',
@srvproduct = '',
@provider = 'MSDASQL',
@datasrc = 'YOUR_DSN'
GO

--List all tables:
EXEC sp_tables_ex @table_server = 'MYOB'

--Select from a Linked table:
SELECT * FROM OPENQUERY(MYOB, 'SELECT * FROM arcust')
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文