16,011,538 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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);
}
}