I am trying to write a PS script that will open the stored parameters proc, pass and execute this proc, and then output the data to a DataSet. This seems to work, but I'm trying to create a .NET object inside an Add-Type block, I get an error:
The type or namespace "Data" does not exist in the namespace "System", (do you miss the assembly reference?)
Here is the code:
Add-Type @' using System.Data; using System.Collections.Generic; public class TestObject {...} '@
The part that really confuses me is that I create a DataSet in another part of the code outside of the .NET class, and the link to System.Data.DataSet works fine.
Any thoughts on this are greatly appreciated.
source share