Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to update Content of Exel sheet [modified]

How to update Content of Exel sheet [modified]

Scheduled Pinned Locked Moved ASP.NET
tutorialhelpannouncement
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member 4659001
    wrote on last edited by
    #1

    In One of my page i need to read the data from Exel Sheet , and After reading the content form it I need to delete the content of Exel Sheet (means i need to delete all rows it contain I have done till how to read data from exel , Now i need to blank it so Plz Guide me how to Blank Exel sheet Well for deleting i used a function private void call1() { string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\OrderHeader.xls;Extended Properties=""Excel 8.0;HDR=YES;"""; DbProviderFactory factory = DbProviderFactories.GetFactory("System.Data.OleDb"); using (DbConnection connection = factory.CreateConnection()) { connection.ConnectionString = connectionString; using (DbCommand command = connection.CreateCommand()) { command.CommandText = "Delete from [OrderHeader$]"; connection.Open(); command.ExecuteNonQuery(); } } } But it is giving error msg Deleting data in a linked table is not supported by this ISAM.

    Raghvendra

    modified on Wednesday, March 4, 2009 9:29 AM

    J 1 Reply Last reply
    0
    • M Member 4659001

      In One of my page i need to read the data from Exel Sheet , and After reading the content form it I need to delete the content of Exel Sheet (means i need to delete all rows it contain I have done till how to read data from exel , Now i need to blank it so Plz Guide me how to Blank Exel sheet Well for deleting i used a function private void call1() { string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\OrderHeader.xls;Extended Properties=""Excel 8.0;HDR=YES;"""; DbProviderFactory factory = DbProviderFactories.GetFactory("System.Data.OleDb"); using (DbConnection connection = factory.CreateConnection()) { connection.ConnectionString = connectionString; using (DbCommand command = connection.CreateCommand()) { command.CommandText = "Delete from [OrderHeader$]"; connection.Open(); command.ExecuteNonQuery(); } } } But it is giving error msg Deleting data in a linked table is not supported by this ISAM.

      Raghvendra

      modified on Wednesday, March 4, 2009 9:29 AM

      J Offline
      J Offline
      Jorgen Andersson
      wrote on last edited by
      #2

      You can't do that, Excel isn't a relational datasource. You can delete values in fields (cells). But you can't delete an entire record at once.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups