473,406 Members | 2,336 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

OledbException : IErrorInfo.GetDescription failed with E_FAIL(0x80004005).

snehil
19
Hi,
I m getting this exception using the following code in a windows Form application using Access database
can anyone please explain me what m doing wrong..
similar code with sqlclient is running perfectly fine..
the exception
IErrorInfo.GetDescription failed with E_FAIL(0x80004005).
is being generated at the code

Expand|Select|Wrap|Line Numbers
  1. da.Fill(dt);
Expand|Select|Wrap|Line Numbers
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.Data.OleDb;
  10.  
  11. namespace MSACCESS
  12. {
  13.     public partial class Form1 : Form
  14.     {
  15.         public Form1()
  16.         {
  17.             InitializeComponent();
  18.         }
  19.  
  20.         private void button1_Click(object sender, EventArgs e)
  21.         {
  22.  
  23.             OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\\StickiesTest.mdb");
  24.             OleDbCommand cmd = new OleDbCommand("Select cast(max(id)as integer) from notes;", conn);
  25.             OleDbDataAdapter da = new OleDbDataAdapter(cmd);
  26.             DataTable dt = new DataTable();
  27.             da.Fill(dt);
  28.             int n = (int)dt.Rows[0][0];
  29.             textBox1.Text = n.ToString();
  30.  
  31.  
  32.         }
  33.     }
  34. }
  35.  
  36.  
I'm also attaching the screenshot of database if you wish to see it..

thanx in advance. :)
Attached Images
File Type: jpg db.jpg (37.8 KB, 674 views)
Oct 26 '10 #1
1 10502
snehil
19
resolved..
it worked when i removed cast as integer from the sql query..
Oct 27 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: matt | last post by:
Hi There we have a new asp.net site that is getting a lot of hits. I have set this up on its own server with its own database server. We have a search system built into the site which is timing...
0
by: Arif | last post by:
In my C# application all queries runs well both with MS Access and SQL Server databses. But only the following query runs well on SLQ Server2000 but with MS Access gives error =>...
1
by: VB Programmer | last post by:
I am getting a "IErrorInfo.GetDescription failed with E_FAIL" error when trying to do a "Fill" on a dataadapter. Any ideas?? The SQL command seems good (to an Access db). Here is the general...
1
by: TG | last post by:
This is a snippet from my code. When I run it, I get the error message "IErrorInfo.GetDescription failed with E_FAIL(0x80004005). " I can't find anything online that helps me to understand the...
5
by: ray well | last post by:
i'm using a standard access 2000 mdb file, and i have used many before, thru ado.net when i run the DataAdapter configuration wizard, i get the following message the wizard detected the...
0
by: mkl | last post by:
Hello I use this code to read a Excel File. Dim connectString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=e:\test\bla.xls;Extended Properties='Excel .0;HDR=YES;'"...
0
by: Anish G | last post by:
I am trying to do Excel Import with Oledb. It is working fine in my local machine. But when i upload it to live server, getting the below given error: E_FAIL(0x80004005) Any help will be...
0
by: Nathan Sokalski | last post by:
I am recieving the following error message when I call the Fill() method in ASP.NET/VB.NET: IErrorInfo.GetDescription failed with E_FAIL(0x80004005). I have looked for help on this error...
1
by: 1983.yadav | last post by:
Hi All, I m Pankaj, i ve a problem in accessing data from MS-Access Table. The error is System.Data.OleDb.OleDbException: IErrorInfo.GetDescription failed with E_FAIL(0x80004005) My query to...
0
by: kuzen | last post by:
Hi Main.Cmd.CommandText = "SELECT ID, NAME FROM NAMES;" Main.DA.SelectCommand = Main.Cmd Main.DT = New DataTable Main.DA.Fill(Main.DT) ComboBox3.DataSource = Main.DT ComboBox3.ValueMember =...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.