Quantcast
Channel: BizTalk Server General Forum
Viewing all articles
Browse latest Browse all 872

BizUnit 4.0 Deleting rows from a table - Setup / Clean up Step

$
0
0

I am upgrading to BizUnit 4.0 and porting the setup step DatabaseDeleteStep. Apparently in 4.0 there is no db delete step. So I used the DbQueryStep with RawSqlString. The problem is that its failing with this reason

BizUnit.TestStepExecutionException: BizUnit encountered an error executing a test step ---> System.IndexOutOfRangeException: Cannot find table 0.
which is obvious because the raw sql

DELETEFROM [AnnuitiesDB].[Staging].[CommonwealthAgents]

will not return any tables.

Is there a step equivalent to DatabaseDeleteStep in BizUnit 4.0?

My Code:

var cleanDB = new DbQueryStep();

        cleanDB.ConnectionString =
            "Data Source=(local);Initial Catalog=AnnuitiesDB;Integrated Security=SSPI;";

        cleanDB.NumberOfRowsExpected = 0;
        cleanDB.SQLQuery = new SqlQuery { RawSqlQuery = "DELETE FROM [Staging].[CommonwealthAgents] where (CwAAgentId='1ead5c1ab65b677f013338baa2e6636fb1c59581' or CwAAgentId='965500bfdb81b2f4595e50cac3078871c5fc4126')" };
        testCase.SetupSteps.Add(cleanDB);




Viewing all articles
Browse latest Browse all 872

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>