AsDataSet() configuration options: Powershell Notation
See original GitHub issueYour Example for C#:
var result = reader.AsDataSet(new ExcelDataSetConfiguration() {
ConfigureDataTable = (_) => new ExcelDataTableConfiguration() {
UseHeaderRow = true
}
});
My rudimenary Basic snippet in PS5.1:
# ExcelDataTableConfiguration => okay
$dTabCnfObj = New-Object ExcelDataReader.ExcelDataTableConfiguration
$dTabCnfObj.UseHeaderRow = $true
# ExcelDataSetConfiguration => okay
$dSetCnfObj = New-Object ExcelDataReader.ExcelDataSetConfiguration
$dSetCnfObj.UseColumnDataType = $true
# and now beginns the pain (add ExcelDataTableConfiguration to ExcelDataSetConfiguration):
$dSetCnfObj.ConfigureDataTable = "???? [working Example please]"
# $dSetCnfObj.ConfigureDataTable = $dTabCnfOb didd not work of course ;-)
How accomplish the Same functionality in Powershell (native or with linq)? Can you translate this snippet to Powershell-Natation, please?
Thank you for any assistance
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top Results From Across the Web
AsDataSet() configuration options UseColumnDataType ...
UseColumnDataType in AsDataSet() configuration options doesn't work if set to False. Even if set to False, the data will be imported with ...
Read more >DbDataAdapter.Fill Method (System.Data.Common)
NET Framework data provider retrieves schema information for only the first result. Notes to Inheritors. This overload of the Fill(DataSet) method is protected ......
Read more >SCOMHelper.psm1 1.0
Operations Manager Powershell script to output the effective monitoring configurations for a specified object ID, group, or Computer name. .DESCRIPTION Will ...
Read more >Google BigQuery v2 API - Class BigQueryClient (3.4.0)
The BigQueryClient class only provides convenience operations built on top of an existing service object. Any more complex operations which are not ...
Read more >List datasets | AutoML Translation Documentation
List existing datasets. Explore further. For detailed documentation that includes this code sample, see the following: Creating and managing datasets. Code ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That looks neat. I prefer your approach with the anonymous lambda.
Seems I made more mistakes in my code sample, f.ex the syntax for passing a method is
$function:ConfigureDataTableCallback
. Apparently I should stop posting untested code samples for a language I’m not familiar with =)Have updated my original sample with a more complete script - and actually tested now!
Closing, I think we solved this
No i have the Trick found 😉
This works for me.
Any better Approaches welcome 😃