c# - Reading data from a SAS data source in .Net -
i've been asked read data sas in asp.net application. i've got working code windows forms app. same code doesn't work in asp.net can try it. clean project same references consistently fails.
here's i've got connection:
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 * 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();
with fails initialising data adapter inner exception of "attempted read or write protected memory. indication other memory corrupt." if add trust=full web.config file same error directly when filling data adapter. can prove executing sas command via workspace manager working, it's when try read results fails when initialising connection sas. whatever reason, fragment
oledbdataadapter ooledbdataadapter = new oledbdataadapter (<read command>, "provider=sas.iomprovider.1; sas workspace id=" + osasworkspace.uniqueidentifier);
which seems cited everywhere how keeps raising error when run through asp.net.
i'm guessing it's user permissions issue somewhere not liking running under iis user wouldn't know needs permissions granted it. sas documentations somewhere or other (sorry, can't find it) suggested making sure user had permissions, aspnet user have full access whole sas program directory on dev machine. know else might need set? thanks.
what version of sas using? starting 9.13, workspacemanager deprecated in favor of objectmanagermulti (or objectmanagermulti2 in 9.2). i'm not sure solve error though.
Comments
Post a Comment