Groups | Blog | Home
all groups > dotnet ado.net > march 2008 >

dotnet ado.net : Help with multiple connector/table query


Alan Morris
3/26/2008 10:11:26 AM
As a newbie to ADO.NET I am struggling with the following:

I have an ODBC data table that I want to use a source for updates to a
SQL server table, I envisage the sql query having the following
structure:-

INSERT INTO SQL_TABLE FROM SELECT ODBC_TABLE WHERE ODBC_TABLE.KEY NOT
IN (SELECT SQL_TABLE.KEY FROM SQL_TABLE)

How do I do this in ado.net if a sql query is run against a specific
connection object?

Hope the above makes sense.

Help greatly appreciated.

Regards,
William Vaughn [MVP]
3/26/2008 10:12:58 AM
1) Why are you using ODBC to access SQL Server? SqlClient is faster, has
100% coverage of SQL Server features as well as easier management (no DSNs
or other ODBC dependencies). ODBC is useful when working with databases that
do not have .NEW managed providers.
2) To execute any query from ADO.NET you need to build a "Command" object
whose CommandText is set to the SQL text for the query.

I expect my book would help. It's designed to help both beginners and pros
work with ADO.NET, SQL Server and VB.NET.

hth

--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
[quoted text, click to view]
Alan Morris
3/26/2008 11:43:14 PM
Many thanks your reply, I am using ODBC because the source database is
proprietary (non SQL server).

Regards,

On Wed, 26 Mar 2008 10:12:58 -0700, "William Vaughn [MVP]"
[quoted text, click to view]
AddThis Social Bookmark Button