Click here to Skip to main content
16,011,538 members

Comments by PrakashPaul (Top 3 by date)

PrakashPaul 1-Dec-17 8:10am View    
I found another way for doing this, client side calling, but problem is it is failing in IE with exception, but worked in chrome and Firefox.
//LoginUrl='http://b.com/jjweb/app?username=jj_123&password=XXXX'
//PlayerUrl='http://b.com/jjweb/Contain.aspx?page=ScreenHtml5&service=page&offset=0&quickrewindsec=-5&quickadvancesec=5'
function doit(LoginUrl, PlayerUrl) {
jQuery.support.cors = true;
$.ajax({
url: LoginUrl,
type: 'GET',
dataType: 'script',
success: function (data) {
// alert(data);
window.open(PlayerUrl, '_blank');
},
error: function (x, y, z) {
alert(x + '\n' + y + '\n' + z);
}
});
}

any hints why it is not worked in IE, IE exception is "JavaScript critical error at line 1, in http://b.com/jjweb/app?username=jj_123&password=XXXX&_=1512059288452\n\nSCRIPT1002: Syntax error"

PrakashPaul 1-Oct-15 17:47pm View    
Thanks for the solution it is working partially, means in debug mode it is producing perfectly but in run it is not wait for all open task to complete.

my objective is, I have to present data from multiple servers, and at run-time as per user privilege I hit the databases(number of server).
to reduce the execution time I want to run the db function in multi-thread. so that I can save time.
but I want to wait till all started thread till not completed. and marge all output for next line of execution.

Hope I am able to clear my issue..

Actual code

[WebMethod]
public string GetCallDetails(string SearchXml, string[] countryList)
{
try
{
ArrayList alstOuput = new ArrayList();

System.Threading.Tasks.Parallel.For(0, countryList.Length, (i) =>
{
string strCountry = countryList[i];
//foreach (string strCountry in countryList)
//{
string strCountryConfig = string.Empty;
string strConnection = string.Empty;

try
{
strCountryConfig = "SQL_" + strCountry;
try
{
strConnection = AppConfigCache.Instance().GetConfigItem(strCountryConfig);
}
catch { }

if (!string.IsNullOrEmpty(strConnection))
{
string strXML = AppConfigCache.Instance().GetConfigItem("CORP_CONFIG_FOLDER");
Search objSearch = (Search)XMLManager.LoadFromXml(typeof(Search), SearchXml);
ArrayList CallDetailsList = objSearchFacade.GetCallDetails(objSearch, strConnection, strXML);
//lock (this._lockobject)
//{
alstOuput.AddRange(CallDetailsList);
//}
}
}
catch (Exception _exp)
{
LogManager.LogInformation(string.Format("GetCallDetails(), Error When Process DB Records : {0}", strCountryConfig));
LogManager.LogInformation(string.Format("GetCallDetails(), ERROR : {0}", _exp.ToString()));
}
//}
});
return XMLManager.ToXml<search>(alstOuput);
}
catch (Exception e)
{
throw (e);
}
}
PrakashPaul 1-Oct-15 17:45pm View    
Thanks for your comment. my objective is, I have to present data from multiple servers, and at run-time as per user privilege I hit the databases(number of server).
to reduce the execution time I want to run the db function in multi-thread. so that I can save time.
but I want to wait till all started thread till not completed. and marge all output for next line of execution.

Hope I am able to clear my issue..
Actual code

[WebMethod]
public string GetCallDetails(string SearchXml, string[] countryList)
{
try
{
ArrayList alstOuput = new ArrayList();

System.Threading.Tasks.Parallel.For(0, countryList.Length, (i) =>
{
string strCountry = countryList[i];
//foreach (string strCountry in countryList)
//{
string strCountryConfig = string.Empty;
string strConnection = string.Empty;

try
{
strCountryConfig = "SQL_" + strCountry;
try
{
strConnection = AppConfigCache.Instance().GetConfigItem(strCountryConfig);
}
catch { }

if (!string.IsNullOrEmpty(strConnection))
{
string strXML = AppConfigCache.Instance().GetConfigItem("CORP_CONFIG_FOLDER");
Search objSearch = (Search)XMLManager.LoadFromXml(typeof(Search), SearchXml);
ArrayList CallDetailsList = objSearchFacade.GetCallDetails(objSearch, strConnection, strXML);
//lock (this._lockobject)
//{
alstOuput.AddRange(CallDetailsList);
//}
}
}
catch (Exception _exp)
{
LogManager.LogInformation(string.Format("GetCallDetails(), Error When Process DB Records : {0}", strCountryConfig));
LogManager.LogInformation(string.Format("GetCallDetails(), ERROR : {0}", _exp.ToString()));
}
//}
});
return XMLManager.ToXml(alstOuput);
}
catch (Exception e)
{
throw (e);
}
}