Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You should limit your amount of rows in your Sql for example...</p> <pre><code>SELECT TOP 10000 * FROM SomeTable; </code></pre> <p>if you don't do this, and you have 1.8M in your query, then there is no system able to handle it.</p> <p>But this will make your app to process only the first 10000 rows... if you need to process all rows, then you should iterate the execution of that sql unitl there are not more rows... for example</p> <pre><code>public IoSqlReply GetResultSet(String directoryName, String userId, String password, String sql) { IoSqlReply ioSqlReply = new IoSqlReply(); DataTable dtResultSet = new DataTable(); IoMsSQL ioMsSQL = null; bool keepProcessing = true; try { using (OdbcConnection conn = new OdbcConnection(cs)) { conn.Open(); while (keepProcessing) { using (OdbcCommand cmd = new OdbcCommand(sql, conn)) { using (OdbcDataReader reader = cmd.ExecuteReader()) { if (reader.HasRows) { for (int col = 0; col &lt; reader.FieldCount; col++) { String colName = reader.GetName(col); String colDataType = reader.GetFieldType(col).ToString(); ; dtResultSet.Columns.Add(reader.GetName(col), reader.GetFieldType(col)); } // now copy each row/column to the datatable while (reader.Read()) // loop round all rows in the source table { DataRow row = dtResultSet.NewRow(); for (int ixCol = 0; ixCol &lt; reader.FieldCount; ixCol++) // loop round all columns in each row { row[ixCol] = reader.GetValue(ixCol); } // ------------------------------------------------------------- // finished processing the row, add it to the datatable // ------------------------------------------------------------- dtResultSet.Rows.Add(row); GC.Collect(); // free up memory }//closing while ioSqlReply.DtResultSet = dtResultSet; // return the data table ioSqlReply.RowCount = dtResultSet.Rows.Count; Console.WriteLine("DTRESULTSET:ROW COUNT FINAL : " + dtResultSet.Rows.Count); ioSqlReply.Rc = 0; } else { keepProcessing = false; } } } } } } </code></pre> <p>This is a very rough example... It can be improved but I think it is an easy fix for your problem.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload