문제

Why does this work:

$cmd = new-object System.Data.OleDB.OleDbCommand

and why doesn't this:

$sql = new-object Microsoft.SqlServer.SMO

How do I know which classes need this "special" treatment?

올바른 솔루션이 없습니다

다른 팁

SMO isn't a class, it's a namespace. You need to instantiate an object in the namespace. For instance, if you wanted a server, you'd do:

$server = new-object Microsoft.SqlServer.Management.Smo.Server "yourServer";
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top