View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
onedaywhen[_2_] onedaywhen[_2_] is offline
external usenet poster
 
Posts: 74
Default Overwriting existing data in an Excel worksheet using ADO.Net

Joel Gordon wrote:

I have changed my code to always attempt to
DROP the table. Unfortunately when I attempt to write the data table

to a
workbook which has had a successful DROP table done then I get the

exception :

System.InvalidOperationException: Dynamic SQL generation for the

UpdateCommand
is not supported against a SelectCommand that does not return any key

column
information.


See:

PRB: Error Occurs When You Use ADO.NET OLEDbDataAdapter to Modify Excel
Workbook
http://support.microsoft.com/default...b;en-us;316756

Another 'resolution' to the problem us to write the dynamic SQL
yourself e.g. using Jet's INSERT INTO..SELECT syntax, perhaps using an
ODBC connection to the data source. Old technology yes, but then so is
Excel <g.

Jamie.

--