Hello;

I am have written a few lines of programming code that returned data from a SQLBase database. This code has been running successfully without fail up until yesterday afternoon. No changes has been done to it, but the program now crashes with an Time Out Error on the OleDBDataAdaptor.fill method. The data returned for the SQL query is only 2rows and 10Columns. I am quite baffled as to what may have caused this.

protected IList<T> GenericGetAll<T>(string sql, string key, ObjectGenerator<T> generator)
        {
           

            OleDbCommand command = new OleDbCommand(sql, conn);//, trans);
            //command.Parameters.Add(new OleDbParameter("bor_bar_no", key));
            DataTable table = ExecuteDataTable(command,key);
            List<T> entities = new List<T>();
            //foreach (DataRow row in table.Rows)
            foreach(DataRow row in table.rows)
            {
                entities.Add(generator(row));
            }
            return entities;

protected DataTable ExecuteDataTable(OleDbCommand command, string key)
        {
            DataTable dataTable = new DataTable();
            para = new OleDbParameter();
            para.Value = key;
            command.Parameters.Add(para);
            OleDbDataAdapter oleDbDA = new OleDbDataAdapter(command);
                oleDbDA.Fill(dataTable);
           
            return dataTable;
}

i think you have to clean and build solution again .


Krishna Bhanu

How many users are we talking about here and what is the back end database? For example if this application has a large number of users and is powered by MSSQL you could have a problem with locks in your database. If five users request a table lock then the second user will have to wait for the first user, and the third will wait for the second, etc. Anyone that waits in line for longer than the timeout will receive this exception.

Provider a little more information on your database and post your query.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.