ODBC to SQL DATABASE using C# ADO.net

778 Views Asked by At

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.

2

There are 2 best solutions below

1
On

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.

0
On

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