I experience a small bug with the comments into a sql script.
For instance the following script
************************
-- Selection de l 'article
-- Selection of the article
SELECT 1
************************
set the error :
Error :
Closing ' expected.
Error into comments
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
Could you please specify the following:
- the DBMS (e.g., SQL Server, MySQL or PostgreSQL) which you are connecting to;
- how exactly you are executing the script;
- whether you are receiving the error at design-time or at run-time;
- in the latter case, the exact message of the exception thrown and its stack trace.
- the DBMS (e.g., SQL Server, MySQL or PostgreSQL) which you are connecting to;
- how exactly you are executing the script;
- whether you are receiving the error at design-time or at run-time;
- in the latter case, the exact message of the exception thrown and its stack trace.
OK
DMBS : SQL Server
Execution through the UniConnection provider and the script :
DataSet RunSQL(IDbConnection objConnexion, IDbCommand objCommand, IDataAdapter objAdapter, string strSubScript)
{
DataSet objDS = new DataSet();
objCommand.CommandType = CommandType.Text;
objCommand.CommandText = strSubScript;
objAdapter.Fill(objDS);
return objDS;
}
Error msg : "Closing ' expected."
Stack :
à Devart.Data.Universal.UniCommand.a(CommandBehavior A_0, IDisposable A_1, Int32 A_2, Int32 A_3, Boolean A_4)
à Devart.Data.Universal.UniCommand.InternalExecute(CommandBehavior behavior, IDisposable stmt, Int32 startRecord, Int32 maxRecords)
à Devart.Common.DbCommandBase.InternalExecute(CommandBehavior behavior, IDisposable stmt, Int32 startRecord, Int32 maxRecords, Boolean nonQuery)
à Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior, Boolean nonQuery)
à Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior)
à System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
à System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
à System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
à System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
à RunScript.RunSQL(IDbConnection objConnexion, IDbCommand objCommand, IDataAdapter objAdapter, string strSubScript) dans C:\Dev\Code\InternalFunctions\RunScript.cs:ligne 527
DMBS : SQL Server
Execution through the UniConnection provider and the script :
DataSet RunSQL(IDbConnection objConnexion, IDbCommand objCommand, IDataAdapter objAdapter, string strSubScript)
{
DataSet objDS = new DataSet();
objCommand.CommandType = CommandType.Text;
objCommand.CommandText = strSubScript;
objAdapter.Fill(objDS);
return objDS;
}
Error msg : "Closing ' expected."
Stack :
à Devart.Data.Universal.UniCommand.a(CommandBehavior A_0, IDisposable A_1, Int32 A_2, Int32 A_3, Boolean A_4)
à Devart.Data.Universal.UniCommand.InternalExecute(CommandBehavior behavior, IDisposable stmt, Int32 startRecord, Int32 maxRecords)
à Devart.Common.DbCommandBase.InternalExecute(CommandBehavior behavior, IDisposable stmt, Int32 startRecord, Int32 maxRecords, Boolean nonQuery)
à Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior, Boolean nonQuery)
à Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior)
à System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
à System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
à System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
à System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
à RunScript.RunSQL(IDbConnection objConnexion, IDbCommand objCommand, IDataAdapter objAdapter, string strSubScript) dans C:\Dev\Code\InternalFunctions\RunScript.cs:ligne 527
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
Thank you for the code sample. It is not recommended to use complex comments in UniCommand.CommandText, as the UniCommand class is designed for execution of single commands only. To execute complex scripts containing multiple commands and detailed comments, please use the UniScript component:
http://www.devart.com/dotconnect/univer ... cript.html
http://www.devart.com/dotconnect/univer ... cript.html