我正在使用下面的代码将 windows .net 应用程序连接到 sas,但我收到一条错误消息,指出
不允许隐式转换
在我们通过 createworkspaceby 服务器方法连接到工作空间的那一行。
你能帮我做这部分吗?
SASWorkspaceManager.WorkspaceManager oWorkspaceManager
= new SASWorkspaceManager.WorkspaceManager();
string xmlInfo = "";
SASWorkspaceManager.ServerDef oServerDef = new SASWorkspaceManager.ServerDef();
oServerDef.MachineDNSName = "server";
oServerDef.Protocol = SASWorkspaceManager.Protocols.ProtocolBridge;
oServerDef.Port = <port>;
oServerDef.BridgeEncryptionAlgorithm = "SASProprietary";
oServerDef.BridgeEncryptionLevel =
SASWorkspaceManager.EncryptionLevels.EncryptUserAndPassword;
SAS.Workspace oSASWorkspace =
oWorkspaceManager.Workspaces.CreateWorkspaceByServer ("",
SASWorkspaceManager.Visibility.VisibilityProcess, oServerDef, "user",
"pass", out xmlInfo);
oSASWorkspace.LanguageService.Submit(
"proc means data = sashelp.class;output out=meanout;run;");
OleDbDataAdapter oOleDbDataAdapter = new OleDbDataAdapter
("select * from work.meanout",
"provider=sas.iomprovider.1; SAS Workspace ID=" +
oSASWorkspace.UniqueIdentifier);
DataSet oDS = new DataSet();
oOleDbDataAdapter.Fill(oDS, "sasdata");
oWorkspaceManager.Workspaces.RemoveWorkspaceByUUID(
oSASWorkspace.UniqueIdentifier);
oSASWorkspace.Close();