2

I am creating a C# Program to generate a SSIS package, does anyone know how to set the ErrorOutput property of an EzOleDbDestination object to "Redirect Row"?

Edit :

EzOleDbDestination db_dest = new EzOleDbDestination(dataFlow)
                    {
                        Name = "Destination " + File_Name,
                        Connection = oldb_connection,
                        Table = "[dbo].[" + File_Name + "]"

                    };
                    EzOleDbDestination db_dest_clean_error = new EzOleDbDestination(dataFlow)
                    {
                        Name = "Destination " + File_Name + "_CleanError",
                        Connection = oldb_connection,
                        Table = "[dbo].[" + File_Name + "_CleanError]"
                    };
                    db_dest.AttachTo(file_source);
                    db_dest_clean_error.AttachTo(db_dest);
                    db_dest.LinkAllInputsToOutputs();
                    db_dest_clean_error.LinkAllInputsToOutputs();
                    dataFlow.AttachTo(Sql_Create);
                    package.SaveToFile("C:\\Users\\LGuerin\\Desktop\\Package_" + Engagement + ".dtsx"); ;

enter image description here

luc guerin
  • 59
  • 4
  • Could you share a bit of your code so we can see how you've currently got the destination configured? – billinkc Jun 03 '20 at 18:08
  • I added the code in question. The Package is generated and the db_dest error link is set to db_dest_CleanError but the parameter 'Error Output' is set to "Fail Component" – luc guerin Jun 03 '20 at 18:20
  • Thank you for supplying the code you're working with. I'm looking through the EzAPI code atm - not that it should matter, but are you using the archived version, from codeplex, the nuget version forked for 2016 or a different release? – billinkc Jun 03 '20 at 18:21
  • Thank you for your answers, I am using the nuget version forked for 2016 – luc guerin Jun 03 '20 at 18:22
  • No luck so far in either the EzAPI source code nor could I string together the bits to do this using the pure [SSIS object model](https://learn.microsoft.com/en-us/sql/integration-services/building-packages-programmatically/connecting-data-flow-components-programmatically?view=sql-server-ver15) It could be that this isn't a use case the SSIS testing team ever implemented which is one of the reasons I moved away from trying to solve problems with the EzAPI. Instead, I find Biml to be far more expressive and capable of building SSIS packages with less fuss – billinkc Jun 03 '20 at 18:38
  • Here's at least a good shove towards how one would [implement error rows](https://learn.microsoft.com/en-us/dotnet/api/microsoft.sqlserver.dts.pipeline.wrapper.idtsbuffer100.directerrorrow?view=sqlserver-2019) IDTSBuffer100.DirectErrorRow Although you might be working with 120/130 for 2016 See if you can find references to that interface and if so, then you can work with that method to handle error rows. – billinkc Jun 03 '20 at 18:59

1 Answers1

1

enter image description here

These two lines make it work, Thank you billinkc for your answers!

luc guerin
  • 59
  • 4