Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 15th, 2005, 10:51 PM
Authorized User
 
Join Date: Aug 2003
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
 
Old September 22nd, 2005, 03:07 PM
Registered User
 
Join Date: Sep 2005
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.

 
Old October 5th, 2005, 02:50 AM
Authorized User
 
Join Date: Aug 2003
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
 
Old September 5th, 2006, 04:51 AM
Registered User
 
Join Date: Oct 2004
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
 
Old December 22nd, 2006, 02:47 PM
Registered User
 
Join Date: Dec 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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





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





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