Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Closed Thread
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 3rd, 2004, 02:20 AM
Registered User
Join Date: Jun 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Update Excel File Using ADO .Net

The following code is not updating the excel file passed in the FileName parameter. No exceptions are being thrown.

public void UpdateExcelFile(string SomeFile)

OleDbConnection Connection = new OleDbConnection();

OleDbCommand Command = new OleDbCommand();

string ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " + SomeFile + ";Extended Properties=Excel 8.0;";

Connection.ConnectionString = ConnectionString;

string MyCommandText = "UPDATE [Sheet1$A1:A1] SET F1 = 'SomethingNew'";

Command.CommandText = MyCommandText;

Command.Connection = Connection;

catch(Exception ex)
{ Connection.Close() }
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Get data from Excel file using ADO.NET lam_lvl ADO.NET 7 February 27th, 2014 05:19 AM
ADO.NET and Excel Theone84 ADO.NET 0 July 7th, 2008 05:20 AM
Problems importing Excel into ADO.Net recordset AshleyC ADO.NET 0 February 22nd, 2005 05:56 AM
Referencing a closed excel file using ADO. cunninb Excel VBA 0 January 10th, 2005 12:29 AM

All times are GMT -4. The time now is 07:35 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.