开发者

ODBC to SQL DATABASE using C# ADO.net

开发者 https://www.devze.com 2023-01-12 21:07 出处:网络
I have MYOB (AccountingSoftware) Database which I can read using ODBC. Now I have dataset containing all tables of MYOB database.

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 crea开发者_如何学Goted automatically and data inserted automatically.


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.


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')
0

精彩评论

暂无评论...
验证码 换一张
取 消