Click here to Skip to main content
12,954,203 members (91,186 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
i tried lot of times but it is not working please help me.

you send your sample code base on that i put my code but it error shows as follows;

IErrorInfo.GetDescription failed with E_FAIL(0x80004005).

Runmode screen as follows;

Code combobox view(Button)


in the combobox all the code details are displayed in the combo box.that code is working fine no problem.


i have one button Called View Button

what i need now is when i click the View Button all the details from the database to be retrieved and displayed into the datagridview.


IN Global function i written the below code
public OleDbConnection OleDbCon = null;
 private string Accessconncetionstring = "Provider=Microsoft.Jet.OLEDB.4.0; Data  Source= E:\\Projects\\Faculty Schedule\\Faculty Schedule\\Data\\HIMTTESTing.mdb;";
   private OleDbCommand OledbCmd;
   private OleDbDataReader OledbDr;
 

               Bindaccessconn function code as follows;
               public void BindAccessConn()
               {
               OleDbCon = new OleDbConnection();
               OleDbCon.ConnectionString = Accessconncetionstring;
               OleDbCon.Open();
               }
View Button code as follows

         <private void="" eventargs="" mode="hold" />        {
 
             System.Data.OleDb.OleDbConnection OleDbCon = new System.Data.OleDb.OleDbConnection();
                GFun.BindAccessConn();
                sql = "select CONVERT(varchar(11), [Sch_Date], 106)  AS schDate, [Session],[Faculty_Code] from Tb_SCh_TIme_Table where Course = '" + cb_Course_Name.Text.ToString().Trim() + "'  order by Date,session";
                OleDbDataAdapter da = new OleDbDataAdapter(sql, GFun.OleDbCon);
                DataTable dt = new DataTable();
                da.Fill(dt);
                DGV_Course_report.DataSource = dt;
}


when i run and click the view button error shows as follows;

IErrorInfo.GetDescription failed with E_FAIL(0x80004005).
what is the problem in my view button code.

kindly please help me. i tried lot of times but in datagridview records not displayed from the database.

help me.

when i debug and check in the below line,
DataTable dt = new DataTable();
dt is null.why dt value is null.
i tried lot of times but it is not working.


Rgds & Thanks,
Narasiman.
Posted 30-Jan-13 2:43am
Updated 30-Jan-13 5:40am
CHill60189.8K
v2
Comments
Mantu Singh 30-Jan-13 9:17am
   
Try improving the connection string!!
richcb 30-Jan-13 11:22am
   
The Select statement might be an issue too. I am not sure you can call sql functions using oledb provider.
braop 30-Jan-13 11:48am
   
You connection String...
i think you need to check ur square brackets....Try this..

sql = "SELECT CONVERT(varchar(11), Sch_Date, 106) AS [schDate], [Session],.....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,524
CHill60 3,490
Maciej Los 3,123
ppolymorphe 2,030
Jochen Arndt 1,975


Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 30 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100