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
Register
| 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
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 15th, 2005, 10:51 PM
Authorized User
 
Join Date: Aug 2003
Location: HCM, HCM, Vietnam.
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default Unspecified Error.

Dear All,

I have a ASPX page. It will read data from an Excel file and bind into DataGrid but I have problem:

File source:

Private sub BindGrid()
   Dim strSQL As String
   Dim strConn As String

   'Connection String
   strConn = "Provider=Microsoft.Jet.OleDb.4.0; " & _
             "Data Source=C:\Data.xls; " & _
             "Extended Properties=Excel 8.0;"

   'Declare and initialize connection object
   Dim objConn As New OleDb.OleDb.Connection(strConn)

   strSQL = "SELECT * FROM [Data$]"
   'Data is name of sheet in Excel file

   'Declare and Initialize OledbCommand object
   Dim objCommand As New OleDb.OleDbCommand(strSQL, objConn)

   'Open connection
    objConn.Open()

    'dgData is name of DataGrid
    Me.dgData.DataSource = objCommand ExecuteReader(CommandBehavior.CloseConnection)

    Me.dgData.DataBind()
End Sub

But I received this ERROR:


Exception Details: System.Data.OleDb.OleDbException: Unspecified error

Source Error:

Line 77: Dim objConn As New OleDbConnection(strConn)
Line 78: Dim strSQL As String = "Select * FROM [Data$]"
Line 79: objConn.Open()
Line 80:
Line 81: Dim objCmd As New OleDbCommand(strSQL, objConn)

Source File: E:\Inetpub\wwwroot\GUIVP\Admin\ImportData.aspx.vb Line: 79

Stack Trace:

[OleDbException (0x80004005): Unspecified error]
   System.Data.OleDb.OleDbConnection.ProcessResults(I nt32 hr) +20
   System.Data.OleDb.OleDbConnection.InitializeProvid er() +57
   System.Data.OleDb.OleDbConnection.Open() +203
   GUIVP.ImportData.BindData() in E:\Inetpub\wwwroot\GUIVP\Admin\ImportData.aspx.vb: 79
   GUIVP.ImportData.Page_Load(Object sender, EventArgs e) in E:\Inetpub\wwwroot\GUIVP\Admin\ImportData.aspx.vb: 48
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.Control.LoadRecursive() +35
   System.Web.UI.Page.ProcessRequestMain() +750



Please help me!
Thank you so much.

L.V.L
__________________
L.V.L
Reply With Quote
  #2 (permalink)  
Old September 22nd, 2005, 03:07 PM
Registered User
 
Join Date: Sep 2005
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In the excel document on the bottom left corner their are tabs that name each datasheet, is the name of the sheet actually Data or is it Sheet1? The default given by excel Sheet1. If it is Sheet1, rename the sheet to Data.

Reply With Quote
  #3 (permalink)  
Old October 5th, 2005, 02:50 AM
Authorized User
 
Join Date: Aug 2003
Location: HCM, HCM, Vietnam.
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you very much

I found cause of problem!

User permission !



L.V.L
Reply With Quote
  #4 (permalink)  
Old September 5th, 2006, 04:51 AM
Registered User
 
Join Date: Oct 2004
Location: Petlad, Gujarat, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

evevn i am getting the same error. can u help me please

Pranav Shah
Reply With Quote
  #5 (permalink)  
Old December 22nd, 2006, 02:47 PM
Registered User
 
Join Date: Dec 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

try this patch http://support.microsoft.com/kb/827190
Reply With Quote
Reply


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
Unspecified error mahesh_82 ADO.NET 1 January 10th, 2007 06:24 AM
Unspecified Error??? werD420 Classic ASP Databases 2 April 10th, 2005 01:00 PM
unspecified error Meterman Classic ASP Databases 1 July 13th, 2004 10:19 AM



All times are GMT -4. The time now is 11:47 AM.


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