1

I'm using IronSpeed Designer 12.2 and trying to write custom SQL in a WhereClause override. The custom SQL I wrote and submitted in the WhereClause is throwing an SQL exception, but I can't see the SQL IronSpeed is sending to the database. Without the SQL, I cannot troubleshoot.

I can't find where the SQL is submitted to the database, such as by an ExecuteReader method call.

I'm using a statement like this:

if (MiscUtils.IsValueSelected(this.MyFilter)) {                              
            String sql = "(EXISTS (SELECT TOP 1 CompanyId FROM Collateral as c WHERE CODE = '{0}' AND c.CompanyId = Company.CompanyId))";
            wc.iAND(String.Format(sql, this.MyFilter.SelectedValue));                
        }

I know my WhereClause SQL is correct when used outside of IronSpeed because I copy-pasted it from a query working directly in MSSQL. However I can't see how IronSpeed combines it with its internally-generated SQL after it becomes a WhereClause.

I'm hoping someone has experience with this issue and can point me in the right direction. Thanks for the help!

4

1 回答 1

1

如果您寻找答案的时间足够长,您可以自己找到答案。以下是我发现您可以检查发送到数据库的 SQL 的方法:

  1. 转到 C:\Program Files\Iron Speed\Designer v12.2.0。
  2. 将 BaseClasses 文件夹复制到 IronSpeed 解决方案文件夹的根目录。
  3. 将现有的 BaseClasses 项目添加到 IronSpeed 解决方案。
  4. 从 IronSpeed 解决方案的项目中删除对 baseclasses.dll 的现有引用(我使用的是 Web 应用程序而不是网站项目)。
  5. 添加对现在包含在解决方案中的 BaseClasses 项目的引用。
  6. 打开文件 MicrosoftDynamicSQLAdapter.vb。
  7. 在方法 GetRecordValuesEx(...) 中,转到第 1514 行语句“reader = SqlTransaction.ExecuteReader(myCommand, cmdBehavior)”并在此行设置断点。
  8. 运行项目。当断点被命中时,检查 myCommand 对象的命令。
于 2015-09-13T21:15:43.400 回答