Domanda

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?

Nessuna soluzione corretta

Altri suggerimenti

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";
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top