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. Error When Updating the content of Excel File From Code

Error When Updating the content of Excel File From Code

Scheduled Pinned Locked Moved ASP.NET
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

    i updating the content (column F2) of exel sheet with this code this is working fine In My Company LAn. Like i access this code from server And from client Pc I can Update It Using Code Given Below but when i wrote this code at Client server ,And Trying to do the same , it gives the error : Operation Must use an update able Query Code Is given below Protected Sub Call1() Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\OrderHeader.xls;Extended Properties=""Excel 8.0;HDR=YES;""" Dim factory As DbProviderFactory = DbProviderFactories.GetFactory("System.Data.OleDb") Using connection As DbConnection = factory.CreateConnection() connection.ConnectionString = connectionString Using command As DbCommand = connection.CreateCommand() command.CommandText = "Update [OrderHeader$] set F2= 'Used'" connection.Open() command.ExecuteNonQuery() End Using End Using End Sub i need it on urgent basis. Plz ..........

    Raghvendra

    C 1 Reply Last reply
    0
    • M Member 4659001

      i updating the content (column F2) of exel sheet with this code this is working fine In My Company LAn. Like i access this code from server And from client Pc I can Update It Using Code Given Below but when i wrote this code at Client server ,And Trying to do the same , it gives the error : Operation Must use an update able Query Code Is given below Protected Sub Call1() Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\OrderHeader.xls;Extended Properties=""Excel 8.0;HDR=YES;""" Dim factory As DbProviderFactory = DbProviderFactories.GetFactory("System.Data.OleDb") Using connection As DbConnection = factory.CreateConnection() connection.ConnectionString = connectionString Using command As DbCommand = connection.CreateCommand() command.CommandText = "Update [OrderHeader$] set F2= 'Used'" connection.Open() command.ExecuteNonQuery() End Using End Using End Sub i need it on urgent basis. Plz ..........

      Raghvendra

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      This code is accessing a local file which is not within your ASP.NET website. You don't have that access, you need for your excel file to be on the server, below the root directory of your web app.

      Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )

      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