Could not get the ConnectionString from Registry Key
-
I have given the value for the connetionstring and TeamsConnectionString in registry settings but s still i am facing the following error. can anyone please suggest me to resolve this error Error details from event details: --------------------------------- The following information was included with the event: Could not get the ConnectionString from Registry Key =SOFTWARE\Kimberly-Clark\Knowledge Management; Value = TeamsConnectionString Last error number: 0
-
I have given the value for the connetionstring and TeamsConnectionString in registry settings but s still i am facing the following error. can anyone please suggest me to resolve this error Error details from event details: --------------------------------- The following information was included with the event: Could not get the ConnectionString from Registry Key =SOFTWARE\Kimberly-Clark\Knowledge Management; Value = TeamsConnectionString Last error number: 0
-
You need to show the code you are using to get the key, and the exact error message or return code.
lfLog.DebugMsgStart(" Retrieving Connection String");
csKey = "SOFTWARE\\Kimberly-Clark\\Knowledge Management";
if ( !rReg.GetSZValue(HKEY_LOCAL_MACHINE,csKey, csConnectionStringReference, csConnectionString))
{
// could not get program name
lfLog.DebugMsgEnd("FAILED");
csMsg.Format("Could not get the ConnectionString from Registry Key = '%s', Value = '%s'", csKey, csConnectionStringReference);
elLog.ErrorMsg(csMsg);
lfLog.ErrorMsg(csMsg);// log the message code mclLog.ErrorMsg( 0, "ConnectionString"); goto exit30;
}
lfLog.DebugMsgEnd("SUCCESS");and i am having the values in registry under the path mentioned in the code
-
lfLog.DebugMsgStart(" Retrieving Connection String");
csKey = "SOFTWARE\\Kimberly-Clark\\Knowledge Management";
if ( !rReg.GetSZValue(HKEY_LOCAL_MACHINE,csKey, csConnectionStringReference, csConnectionString))
{
// could not get program name
lfLog.DebugMsgEnd("FAILED");
csMsg.Format("Could not get the ConnectionString from Registry Key = '%s', Value = '%s'", csKey, csConnectionStringReference);
elLog.ErrorMsg(csMsg);
lfLog.ErrorMsg(csMsg);// log the message code mclLog.ErrorMsg( 0, "ConnectionString"); goto exit30;
}
lfLog.DebugMsgEnd("SUCCESS");and i am having the values in registry under the path mentioned in the code
Very interesting, but what is happening when you run this code? What does
rReg.GetSZValue
return and where is the class definition for it? What is contained incsConnectionStringReference
andcsConnectionString
? What system calls are being used and if they fail what is returned byGetLastError()
? -
Very interesting, but what is happening when you run this code? What does
rReg.GetSZValue
return and where is the class definition for it? What is contained incsConnectionStringReference
andcsConnectionString
? What system calls are being used and if they fail what is returned byGetLastError()
?code compilation is success an now i am trying to install and run the service in the production server . rReg.GetSZValue success if it successfully fetch the value from regtry path or else failed ,now it is returning fail in log . csConnectionStringReference contained the key name "TeamsConncetionstring" and this value is also ftched from the registry itself. csConnectionString should be stored with the value of the key "TeamsConncetionstring". GetLastError() returning 0 here . And if any error even will log with the error details which i have reported earlier.
-
code compilation is success an now i am trying to install and run the service in the production server . rReg.GetSZValue success if it successfully fetch the value from regtry path or else failed ,now it is returning fail in log . csConnectionStringReference contained the key name "TeamsConncetionstring" and this value is also ftched from the registry itself. csConnectionString should be stored with the value of the key "TeamsConncetionstring". GetLastError() returning 0 here . And if any error even will log with the error details which i have reported earlier.
I'm sorry but that tells us nothing about what is happening. You need to use your debugger to step through the code and see the exact status values that you are receiving when you try to read this value from the registry. You still have not shown the code that does to do the actual call to get the value from the registry, only
rReg.GetSZValue
. -
lfLog.DebugMsgStart(" Retrieving Connection String");
csKey = "SOFTWARE\\Kimberly-Clark\\Knowledge Management";
if ( !rReg.GetSZValue(HKEY_LOCAL_MACHINE,csKey, csConnectionStringReference, csConnectionString))
{
// could not get program name
lfLog.DebugMsgEnd("FAILED");
csMsg.Format("Could not get the ConnectionString from Registry Key = '%s', Value = '%s'", csKey, csConnectionStringReference);
elLog.ErrorMsg(csMsg);
lfLog.ErrorMsg(csMsg);// log the message code mclLog.ErrorMsg( 0, "ConnectionString"); goto exit30;
}
lfLog.DebugMsgEnd("SUCCESS");and i am having the values in registry under the path mentioned in the code
What type of object is
rReg
?"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles