Skip to main content

Hi


There is one error log entry for a process, Which shows " SQL Server does not exist or access denaid".


But i am sure SQL Server is existing and able to access with the credentiald provided in the string table.


When we try to repair the error we got the message that " The error was not repaired successfully, please check DB log and try again".


Could any one please provide the solution for this.


Please find the code as below.


 


public

void Main(ref DestinationRuleContext K2) {


 


 


SourceCode.K2Utilities.DSHelper oDSH =

new SourceCode.K2Utilities.DSHelper(SourceCode.K2Utilities.DSHelper.DSHelperNewOptionsEnum.DefaultLDAPDomain);


System.DirectoryServices.DirectoryEntry oDEManager;


string sManager;


bool bAllTrue = true;


CDest1 oDest1 =

new CDest1();


oDest1.Main(

ref K2);


if (oDest1.IsSuccess == true) {


//== sendto


string strXmlFieldValue = K2.ProcessInstance.XmlFieldse"EDRequest"].Value;


 


string strCFM = @"NORTHAMERICA" + SourceCode.K2Utilities.XMLFieldMod.GetXMLValue(strXmlFieldValue,"//Request/CFUpdate/CFMNetID");


string strPM = @"NORTHAMERICA" + SourceCode.K2Utilities.XMLFieldMod.GetXMLValue(strXmlFieldValue,"//Request/CFUpdate/PMNetID");


 


K2.ProcessInstance.DataFieldsF"CFM"].Value = SourceCode.K2Utilities.XMLFieldMod.GetXMLValue(strXmlFieldValue,"//Request/CFUpdate/CFManager");


K2.ProcessInstance.DataFieldsF"PM"].Value = SourceCode.K2Utilities.XMLFieldMod.GetXMLValue(strXmlFieldValue,"//Request/CFUpdate/ProjectManager");


K2.ProcessInstance.DataFieldsF"ENGINEERS"].Value = SourceCode.K2Utilities.XMLFieldMod.GetXMLValue(strXmlFieldValue,"//Request/CFUpdate/Engineers");


 


string strEngineers = SourceCode.K2Utilities.XMLFieldMod.GetXMLValue(strXmlFieldValue,"//Request/CFUpdate/EngineersId");


if(strEngineers.Length > 0)


{


string s] strEngIds = strEngineers.Split(';');


foreach(string ids in strEngIds)


{


K2.Destinations.Add(DestinationType.User, @"NORTHAMERICA" + ids);


}


}


 


DestUsers dusers =

new DestUsers();


System.Collections.ArrayList arUsers = dusers.GetUsersInRole("Customer Focus Mgr", K2.StringTablei"CustomDB"]);


foreach(string strval in arUsers)


{


K2.Destinations.Add(DestinationType.User, strval);


}


 


System.Collections.ArrayList arPMs = dusers.GetUsersInRole("Project Mgr", K2.StringTabler"CustomDB"]);


foreach(string strPm in arPMs)


{


K2.Destinations.Add(DestinationType.User, strPm);


}


if (bAllTrue == false) return;


}


}


// Destination Classes


 


private

class CDest1 {


public bool IsSuccess = false;


 


public void Main(ref DestinationRuleContext K2) {


this.IsSuccess = true;


}


}

Hi there,


Firstly, I would make sure that if the credentials you specified in the string table involve "integrated authentication" then make sure that the K2 service account under which the K2 Server is running has access to SQL Server.


Secondly, if you are getting the "The error was not repaired successfully" error when you click on repair, then it usually means that the code could not be parsed into valid C# code, so make sure that all your strings are closed properly, etc. Essentially it means that the code in that code window can not compile.


Hope that helps somehow.


 


Reply