Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to resolve Fatal Exception in vb.net?
    primarykey
    data
    text
    <p>I am working on a application and I wrote the code below, </p> <pre><code>Public Function CreateDatatable(ByVal SqlQuery As String, ByVal strTable As String, Optional ByVal OrderbyField As String = "") As DataTable If InitDB() Then Try Dim sqlAdapter As New MySqlDataAdapter() Dim dt As New DataTable() If SqlQuery = "" Then SqlQuery = "Select * from " &amp; strTable &amp; IIf(OrderbyField &lt;&gt; "", " order by " &amp; OrderbyField, "") Dim cmd As New MySqlCommand(SqlQuery, MySQLCon) cmd.CommandTimeout = 18000 sqlAdapter.SelectCommand = cmd dt.TableName = strTable sqlAdapter.Fill(dt) CreateDatatable = dt Catch ex As Exception ServiceLog.WriteEntry("CreateDatatable Exception:" &amp; ex.Message) End Try Else CreateDatatable = Nothing End If End Function </code></pre> <p>After running the code this error occurred.</p> <blockquote> <p>MySql.Data.MySqlClient.MySqlException={"Fatal error encountered during command execution."} at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) at MySql.Data.MySqlClient.MySqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at AgilityNewsService.clsDataware_MySQL.CreateDatatable(String SqlQuery, String strTable, String OrderbyField) in C:\ISMSCleanDesktop\DesktopBkup_Tue10-22-2013\AgilityNewsService\AgilityNewsService\AgilityNewsService\clsDataware_MySQL.vb:line 48</p> </blockquote> <p>How to resolve the above error?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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