Home
|
Tutorial
|
Articles
|
Forum
|
Interview Question
|
Code Snippets
|
News
|
Fun Zone
|
Poll
|
Web Links
|
Certification
|
Search
Welcome :
Guest
Sign In
Register
Win Surprise Gifts!!!
Congratulations!!!
Top 5 Contributors of the Month
Jean Paul
satyapriyanayak
Narayanan
Karthikeyan Anbarasan
JQuery Developer
Home
>>
Forum
>>
ADO.Net
>>
Post New Question
Subscribe to Forum
not able to insert data into excel sheet through windows application in visual studio 2008
Posted By:
vinay
Posted Date:
December 15, 2010
Points:
2
Category :
ADO.Net
Error:
The Microsoft Jet database engine could not find the object 'c:\travel.xls'. Make sure the object exists and that you spell its name and the path name correctly.
following is the code am using:
Dim num As Integer
Dim MyConnection As System.Data.OleDb.OleDbConnection
Dim myCommand As New System.Data.OleDb.OleDbCommand
Dim sql As String
MyConnection = New System.Data.OleDb.OleDbConnection _
("provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + _
"'c:\\travel.xls';Extended Properties=""Excel 8.0;HDR=NO;IMEX=1""")
MyConnection.Open()
myCommand.Connection = MyConnection
sql = "Insert into [vayama$] (id,name) values('5','e')"
myCommand.CommandText = sql
num = myCommand.ExecuteNonQuery()
MyConnection.Close()
Responses
Author:
Raga
Company URL:
http://msdotnettechies.wordpress.com/
Posted Date: March 02, 2011 Points: 20
Try with the following MyConnection = New System.Data.OleDb.OleDbConnection _
("provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + _
"c:\\travel.xls;Extended Properties=""Excel 8.0;HDR=NO;IMEX=1""")
You can direcly give the Filepath. We need not use single quotes.
Post Reply
You must
Sign In
To post reply
Related Questions Related Questions
Export SQL Data to Microsoft Excel (using Visual Studio 2008, c#) in asp.net
Problem with Visual Studio 2008 on Windows 7
Problem for running Windows Application in .net visual Studio 2010
how to copy data from one excel to another excel using windows application
Visual Studio .Net 2008, There are no controls in the toolbox???
Latest Forum Questions From The Same Category
Sql Bulk Insert from multiple delimited Textfile using c#.net
Read *.ds file to Dataset Object
TNS:address already in use Exception
Accessing Virtual folder
Dynamically Insert single record into MS access from SQL server
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more
Here
Quick Links For Forum Categories:
ASP.Net
Windows Application
.NET Framework
C#
VB.Net
ADO.Net
Sql Server
SharePoint
OOPs
Silverlight
IIS
JQuery
JavaScript/VBScript
Biztalk
WPF
Patten/Practices
WCF
Others
www.DotNetSpark.com
UnAnswered
All
Hall of Fame
Twitter
Terms of Service
Privacy Policy
Contact Us
Archives
Tell A Friend