Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 4 years and 2 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
i have a Problem using SQL and PowerShell-Studio lates Version 64Bit.
in PowerShell-Studio the Code doesn't work. If i use
PowerShell-ISE the Code works fine.
SQlReader does not have rows in the normal sense. It has to be moved forward with a "read()" command then the data for a row is available. The object can only be read once then it must be closed and reopened to use it again. There is no need to use the reader. Just load the DataTable and you can then do anything you need easily.
The code you are using is badly converted VB.Net code that is floating around the Internet. No programmer would do this with PowerShell. I can tell this because all of the constructs are from the VB.Net examples of how to code with a reader. They are also old and may have come from a bad VBScript example converted to ADO.Net or PowerShell. We haven't used Hungarian notation for 20 years but old VB and VBScri0pt coders seem to continue using it.
This topic is 4 years and 2 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.