|
Multithreading may not be a solution here. The queries you are running dont seem very efficient. If these queries are taking one minute to run, than you might have to rethink what you are attempting.
Here are a few suggestions:
1) Make sure your tables/views are indexed. If they are make sure your indexes are not fragmented. That will cause your queries to take longer than they should.
2) If you are using SELECT * and dont need all those columns, updatethe query to selec the columns you actually need.
3) Use stored procedures instead of inline queries. Stored procedures have an advantage because their statistics/execution plans are stored for future executions. This may increase the time it takes to run your query.
4) Make sure you dont have crazy joins. These are usually a major problem with complex, slow running queries.
5) If you are returing many many many rows, you may want to consider server side paging.
Hope this helps.
|
|
|
|
|
Hi guys,
i am creating a table on runtime, i would like to add a few attributs to this table.
I have so far managed to add:
tr.Attributes.Add("onmouseover", "this.style.backgroundImage='url(images/pagebg.jpg)';this.style.cursor='pointer';");
tr.Attributes.Add("onmouseout", "this.style.backgroundImage='url(images/tagcontent.gif)';this.style.cursor='pointer';");
..but i would also like to add an 'onclick' so that when a user clicks on a row then a radio
button in that table on that row...does anyone know how i can do that?
please help me...
Regards,
Morgs
|
|
|
|
|
Have you tried adding onclick attribute just as you added other attributes? whats the problem you are facing?
|
|
|
|
|
Hi Arun...thanks for your reply,
i don't know how to add an onclick so that a radio button gets checked..
here is the missing part:
tr.Attributes.Add(key, value);
tr.Attributes.Add("onclick", "?");
Please help me..
|
|
|
|
|
MorgSim wrote: tr.Attributes.Add("onclick", "?");
Call javascript function,
tr.Attributes.Add("onclick", "SelectRadioButton('"+ radiobutton.ClientID +"');");
and from that javascriptmethod select the radio button,
function SelectRadioButton(rbtnId)
{
document.getElementById(rbtnId).checked = !document.getElementById(rbtnId).checked;
}
Code is not tested, but I hope this will work.
|
|
|
|
|
Yeahh thanks Alot Arun...worked just fine..
|
|
|
|
|
try like this.
protected void Button1_Click(object sender, EventArgs e)
{
HtmlTable table = new HtmlTable();
HtmlTableRow tr;
HtmlTableCell td;
for(int i=0;i<10;i++)
{
tr = new HtmlTableRow();
tr.ID = "tr" + i.ToString();
string cbxID = string.Empty;
for (int cols = 0; cols < 2; cols++)
{
td = new HtmlTableCell();
if (cols == 0)
{
HtmlInputRadioButton radio = new HtmlInputRadioButton();
cbxID = "rdb" + i.ToString();
radio.ID = cbxID;
radio.Name = i.ToString();
radio.Value = "RadioButton" + i.ToString();
td.Controls.Add(radio);
tr.Controls.Add(td);
}
else
{
td.InnerText = "Row Number" + i.ToString();
td.Attributes.Add("onclick", string.Format("checkRadio('{0}');", cbxID));
td.Style.Add(HtmlTextWriterStyle.Cursor, "pointer");
tr.Controls.Add(td);
}
}
table.Controls.Add(tr);
}
Panel1.Controls.Add(table);
}
<div>
<asp:Button ID="Button1" runat="server" Text="create Table"
onclick="Button1_Click" />
<asp:Panel ID="Panel1" runat="server">
</asp:Panel>
<script language="javascript">
function checkRadio(cbx)
{
document.getElementById(cbx).checked = true;
}
</script>
</div>
[edit] add comments[/edit]
modified on Monday, August 16, 2010 6:46 AM
|
|
|
|
|
Yeah thanks alot man...it worked just fine..
THANKYOU
|
|
|
|
|
hi guys
one page of my site didn't load its element and show me nothing
where the heal are my elements?
i got html source in IE and saw a specific block of java code repeated 5 times
why?
modified on Monday, August 16, 2010 2:40 AM
|
|
|
|
|
Try debugging you may get something..
Also you have not provided enough information. Explain it bit more.
|
|
|
|
|
Hi All ,
I have one application which is listening other application . that code i had written in application_start for that i need to open my page atleast once but i have requirement that as soon as IIS start it should start lisnting no matter page opens onot can u guys give me idea.
thanks,
Amit
|
|
|
|
|
Amit Patel1985 wrote: but i have requirement that as soon as IIS start it should start lisnting no matter page opens onot can u guys give me idea
For that perpose, you will have write an windows service, that will check the IIS status after certain interval.You need to code your logic on this service..
|
|
|
|
|
can you give me some link to do this?
|
|
|
|
|
Find the link for how to create a simple windows service Simple Windows Service Sample
Here, In this as it written you can use a Timer and invoke your own function after a certain interval and check whether IIS started or not accordingly do the operation.
And how to check whether iis is running or not see the link below
Click Here
|
|
|
|
|
What DOes these Error say? :
Server Error in '/' Application.
The process cannot access the file 'XXXX' because it is being used by another process.
and
There is not enough space on the disk.
modified on Saturday, August 14, 2010 3:54 AM
|
|
|
|
|
Something else is using the file "XXXX", like it is open in a text editor or Visual Studio or something (check you don't have it open).
If you don't, something system process is running it.
There is not enough space on the disk is self-explanitory.
If you don't have the file open, you might also have a virus, it might be worth running an anti-virus scan.
ragnaroknrol The Internet is For Porn[^]
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
hi guys
i get a report from my control panel to show me my ftp size
it shows me 19 gb but i downloaded my every file in root and the result is 2gb
my site is parchamdar.com
help me
Please
|
|
|
|
|
I wouldn't be surprised if someone has compromised your account and uploaded pirated materials. I once saw a development SQL server start crashing because someone left anonymous FTP open for convenient backup and restore and pirates uploaded a ripped copy of the movie Titanic (in German) among other things, which filled the drive.
Without knowing what FTP client you used and how you used it there is no way to be sure that you actually downloaded everything. Pirates use lots of tricks like creating directories with names that start with the null character which prevents many FTP clients from seeing or downloading the files.
Of course none of this has anything to do with ASP.Net. It falls more under System Admin.
|
|
|
|
|
My Ftp software is cute ftp ver 8.3
and i use port 20
need any info?
|
|
|
|
|
I do not use Cute ftp so I don't know how well it handles oddly named files. I would suggest using command line FTP. That gives you more options in terms of how to display the contents of your folders. If you need help on how to use it, use the help command. Or simply ask your hosting provider why your dashboard shows a different usage than you would expect. That probably should have been your first step anyway.
|
|
|
|
|
|
Hello,
Does any one know what is Dependency Injection in .net and why we should use it?
thanks
|
|
|
|
|
It means you need to search Google
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hello every1, I went through some article and do realize the DI. the problem is during developing face with the following error.Could you please help me,guys?
it is my code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Ninject.Core;
using SportsStore;
using SportsStore.WebUI.Controllers;
using System.Web.Routing;
using Ninject.Modules;
using Ninject.Core.Modules;
namespace SportsStore.WebUI.Infrastructure
{
public class NinjectControllerFactory : DefaultControllerFactory
{
private IKernel Kernel = new StandardKernel(new SportsStoreServices());
protected override IController GetControllerInstance(RequestContext context,Type controllerType)
{
if (controllerType == null)
return null;
return (IController) kernel.Get(controllerType);
}
private class SportsStoreServices : NinjectModule
{
public override void Load()
{
}
}
}
}
Error occurs in this line:
private IKernel Kernel = new StandardKernel(new SportsStoreServices());
this is the error
<br />
The best overloaded method match for 'Ninject.Core.StandardKernel.StandardKernel<br />
(Ninject.Core.KernelOptions, params Ninject.Core.IModule[])' has some invalid arguments
|
|
|
|
|
It's rather blatantly obvious what the problem is, the error message spells it out. StandardKernal constructor takes two parameters in this case, the first of which is a KernalOptions object. And what are you trying to pass to this constructor?
I know the language. I've read a book. - _Madmatt
|
|
|
|