|
The problem I am trying to address, to start with, is how some of our developers continue to use SQL and Oracle as an application and not for data storage as it was intended. I've seen these immensely complicated SQL statements they have written which is a horrible programming practice and was looking for solutions using modular programming and parallelism. The problem is processing 4 million records in 45 different ways but quickly and efficiently. There are no real problems yet and I stress yet. So far their solution to slow processing is to throw more hardware at it and not increase the efficiency of the actual application.
|
|
|
|
|
Well, you're screwed before you even being.
No amount of hardware or threading or anything other than going back and redesigning and reworking that pile of crap is going solve the problem. You cannot fix bad design with anything, other than redesign.
You can throw all the threads you want at the problem, but they'll all just end up sitting idle waiting the SQL to process. Sure, your application will be starting hundreds of threads, but the SQL server will not be matching you. It'll spin up only what it can work with and will queue up any work it can't readily get to.
|
|
|
|
|
Foothill wrote: All suggestions are appreciated.
It isn't about the threads. It is about the work.
If you have 30 threads querying remote networks is significantly different than having 30 threads working on matrix computations based on in memory data.
Both of those are impacted if you are attempting to run the 'application' on a server that is already running other 'applications'.
And all of that is dependent on whether you do everything correctly. Messing up a single sync and you will suddenly have an application that is running slower than a single threaded app. Or deciding that an optimal solution which completely ignores the bandwidth limits of the network.
|
|
|
|
|
What I am working toward is more of an assembly line approach to some complex financial transactions. Some of my other replies to other posts under this topic will help give a better idea of what I am working toward. This project is testing the feasibility of creating truly modular programming, which is not creating new modules for an existing program and recompiling but passing code changes into an already running program and the code changes are applied without the program missing a beat. In a sense, it would end up a process that would never have to be restarted and processes constantly.
|
|
|
|
|
Foothill wrote: it would end up a process that would never have to be restarted and processes
constantly.
That doesn't really have anything to do with threading however. At least not in the context of what you suggested in your original post.
|
|
|
|
|
<itemtemplate>
<asp:Label ID="ProductPromotionLabel" runat="server"
Text='<%# string.Concat("RM ",Eval("ProductPromotion")) %>'
/>
</ItemTemplate >
how to get the data on productoromationlabel?
|
|
|
|
|
loop through the records in the DataList and search for the Label on the row with the FindControl method
MSDN FindControl[^]
Edit: This is an ASP.Net question. Please use the appropriate forum in the future.
|
|
|
|
|
Control myControl1 = FindControl("ProductPromotionLabel");
if (myControl1 == null)
{
myControl1.Visible = false;
}
thx it work but why cant set to visible it occur error
System.NullReferenceException: Object reference not set to an instance of an object.
|
|
|
|
|
MichaelCheong89 wrote: if (myControl1 == null) In order to prevent an Object reference error, you need to change this to a != null test instead.
|
|
|
|
|
yeah. pretty pointless to check if it's null and then trying to perform an action on it 
|
|
|
|
|
You need to call the FindControl on the correct Control.
If you have a DataList as you said you first need to find the correct record. Example
foreach(var item in MyDataList.Items) {
var myLabel = item.FindControl("ProductPromotionLabel");
if(myLabel !=null) {
myLabel.Visible = false;
}
}
FindControl doesn't consider nesting. The easiest way is to set a breakpoint and look for at the Page with its Controls hierarchy.
|
|
|
|
|
ok thx ^^ 
|
|
|
|
|
how to remove the image button border? when i click on the button it will display the border such as image below.
it does't work when i set the border to none
<asp:ImageButton ID="ImgTop" style="border:none" text="Image not display" runat="server"
ImageUrl='<%# "ShowImgMan.ashx?ProductID=" + Eval("ProductID") %>' Width="195px" Height="190px" />
|
|
|
|
|
|
thx 
|
|
|
|
|
|
I have 1 exercise for separate compound color planes green, red, blue. please help me
|
|
|
|
|
Help you with what? You haven't actually asked a question.
|
|
|
|
|
That sounds like it could be either interesting or trivial.
What exactly do you have to do?
|
|
|
|
|
i wan't to separation and graft color plane for bitmaps
|
|
|
|
|
I'm afraid I still don't really know what you want.
Do you want to: take a bitmap and create 3 separate bitmaps from it, representing the red, green and blue components?
|
|
|
|
|
(smile) exactly, thank you verry much but I have done this exercise, forward to help next time ^^
thank you 
|
|
|
|
|
I am modifying an SSRS 2008 r2 report so users can export the data to excel and sort and filter the data. The only way to accomplsh this task is to remove the report headers.
The users will click on a button that says hide 'headers' and click the view button. Then the users will export to excel.
Problem:When the SSRS 2008 R2 report is exported to excel, row one in excel is blank. The column headers and data start on line #2 in excel. I want to remove line #1 from being blank in excel.
To solve this problem, for the tablix that I want to keep, I want to set the location value to 0,0. I do not want to come up with a new report that looks
like the original report but the data is shifted. I would prefer to write C# code to solve this problem since I can not find a way to set the SSRS tablix.location
property in SSRS.
Thus can you show and/or tell me the following:
1. What C# code can be setup to accomplish my goal?
2. How would you attach the C# code to the SSRS 2008 r2 report for the code to work?
|
|
|
|
|
Hello,
I have html code that need to be converted to PDF by clicking on the button on the webpage.
Generated HTML contains table populated from the recordset.
Please check the code below. It is working, except for some reason in pdf it cuts out last row in the table.
private void GenerateReport(string Html, HttpContext context)
{
MemoryStream stream = createPDF(Html);
context.Response.ContentType = "application/pdf";
context.Response.AddHeader("Content-Disposition", "attachment; filename=\"Report.pdf\"");
context.Response.BinaryWrite(stream.ToArray());
}
private MemoryStream createPDF(string html)
{
MemoryStream msOutput = new MemoryStream();
TextReader reader = new StringReader(html);
Document document = new Document(PageSize.A4,10f,10f,10f,0f);
PdfWriter writer = PdfWriter.GetInstance(document, msOutput);
HTMLWorker worker = new HTMLWorker(document);
document.Open();
worker.StartDocument();
worker.Parse(reader);
worker.EndDocument();
worker.Close();
document.Close();
return msOutput;
}
If i run just html, all rows are displayed. The generated PDF document won't include last row.
Can't figure out why.
Any ideas would be appreciated.
Thanks.
|
|
|
|
|
This is copy of my comment on A Multi-threading Example.
I'm beginner so I have question if anyone can help me.
I've used part of threading code, I have button that should stop the process, but, as you can see in the code below, I have 3 nested loops, and operation in topmost loop (which I've put into thread) takes some time to do the work, and my stop button is not very responsive.
When I put thread sleep to 3 seconds, button is responsive, but that makes topmost loop even slower (by that 3 second per iteration).
What should be simple start stop operation now became much more than I can handle.
I have this code so far:
private void btnCaptureScreen_Click(object sender, EventArgs e) {
if (LIST_CheckedTreeNodes.Count > 0) {
btnCaptureScreen.Enabled = false;
btnSTOP.Enabled = true;
abort_process = false;
thread = new Thread(delegate() {
foreach (iTreeNode node in LIST_CheckedTreeNodes) {
if (abort_process) break;
this.BeginInvoke((ThreadStart)delegate() {
CaptureScreenFromNode(node);
});
if (abort_process) break;
}
this.BeginInvoke((ThreadStart)delegate() {
btnCaptureScreen.Enabled = true;
btnSTOP.Enabled = false;
});
Thread.Sleep(10);
});
thread.Start();
}
}
CaptureScreenFromNode(node) code:
private void CaptureScreenFromNode(iTreeNode node) {
treeView.SelectedNode = node;
string nodePI = node.GetType().GetProperty("iDiagramType").GetValue(node).ToString();
foreach (iComboBox combo in LIST_COMBOX_SelectedLoadCases) {
if (abort_process) break;
Check_Selected_Load_Cases(combo);
string comboPI = combo.GetType().GetProperty("iDiagramType").GetValue(combo).ToString();
if (comboPI == nodePI) {
if (combo.Items.Count > 0) {
for (int j = 0; j < combo.Items.Count; j++) {
if (abort_process) break;
}
}
else {
}
}
}
}
}
Please help 
|
|
|
|