0

I want to pass the value of a string array as a parameter into a CallBimlScript, like the value assigned here:

// Retrieve table list into string array 
var tablesToInclude = ExternalDataAccess.GetDataTable(connectionWrk.ConnectionString,  
                                      "SELECT DISTINCT [TABLE_NAME] " +
                                      "FROM [ETL_WORK].[STG_TBL_CONFIG] " +
                                      "WHERE [TABLE_SCHEMA] ='STG' " +
                                      "AND [LOAD_CONFIG] IN ('PAT','TAP'); "
                                      ).Rows.OfType<DataRow>().Select(r => r[0].ToString());

Which I'm passing into a CallBimlScript with this call:

<#=CallBimlScript("DoStuffWithTableNames.biml", connectionWrk, tablesToInclude)>

And here's the header of the BimlScript I'm calling:

<#@ property name="connectionWrk" type="Varigence.Languages.Biml.Connection.AstOleDbConnectionNode" #>
<#@ property name="tablesToInclude" type="?" #>

Which data type is compatible with the variable I'm using in the CallBimlScript?

0

The GetDataTable method returns System.Data.DataTable But you using Linq to extract the first element of the data row as a string

I'd have to check, but I think you need to chain a ToArray or ToList to the expression and then you'd need to specify to correct enumerable iterable type in the target Biml script.

Otherwise, you should be able to ask the type by using the System.Type class to determine what type is generated in the Linq call.

  • Well, @billinkc, here's what I get for the type: System.Linq.Enumerable+WhereSelectEnumerableIterator`2[System.Data.DataRow,System.String[]]. I have not found a way to specify this type in the callee, yet. – Lernon C. Scharpe Mar 13 at 15:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.