Delete a row from Excel via ADO.NET

  • Thread starter Thread starter Jan Lorenz
  • Start date Start date
Jan said:
Hi,

I have a ADO.NET - Connection to an Excel file. UPDATE and INSERT works
fine. Now I want to DELETE lines, but it doesn't works (I get an error
message "Deleting data in a linked table is not supported by this ISAM.").
Microsoft says, that there is no way to to this
(http://support.microsoft.com/?scid=kb;en-us;257819&x=7&y=11).
Knows anybody a way?

best regards
Jan

maybe you could load complet file in memory (array or datatable) delete
row, and then save as excel file again...

:-D
 
Well, if that doesn't work, then I suggest that there is something very
wrong with your code - I think.

The datatable that you instantiate and fill with datarows is completely
disconnected from the source excel file and, as far as I understand, an
object of ADO.NET

It doesn't even know where it came from and it properties are dependant on
ADO.NET and not on the DataAdapter or source file that were used to build
it.

You can do with it whatever you want within the framework of ADO.NET and
DELETE is an option.

Then you 'pour' it into a newly defined excel file thru a new data adapter.

Perhaps you can post some of your code so that people can see what you are
doing and suggest the corrections necessary????

Garry
 
¤ Hi,
¤
¤ I have a ADO.NET - Connection to an Excel file. UPDATE and INSERT works
¤ fine. Now I want to DELETE lines, but it doesn't works (I get an error
¤ message "Deleting data in a linked table is not supported by this ISAM.").
¤ Microsoft says, that there is no way to to this
¤ (http://support.microsoft.com/?scid=kb;en-us;257819&x=7&y=11).
¤ Knows anybody a way?

There is no support for deleting a row in an Excel Worksheet using data access methods. You would
need to use Excel automation instead.


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Back
Top