Click here to Skip to main content
15,913,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
C#
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

C#
         <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
Updated 30-Jan-13 5:40am
v2
Comments
Mantu Singh 30-Jan-13 9:17am    
Try improving the connection string!!
Richard C Bishop 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900