ADO.NET :: Execute An Sp 1000 Times With Out Any Interupt?
Jan 25, 2011
Me with C#.net and sqlserver 2005. In my application there is a need to insert 1000 products details into my sqlserve table. I am using a for loop to insert and its done using a stored procedure, but when this code executes it stops mostly after 80 iterations and showing the error "Object reference not set to an instance of an object". How can I over come this? How can I make a steady sqlconnection?
i am using sql server inbuilt mail system for sending mail.and i made SP to call dbmail sp
now my problem is when i call sp it get executed fine but in last suppose 1000 mails queued then 1000 times i get mail queued.and that my connection time out .i extend connection time out limit but i get error msg like
"Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. Mail queued."
my mail get queued well proper but due to 1000 or 100000 mail queued its lost of msg make problem.
Let's say we are building some public service that grabs the setup of a user (what server, user and pwd he wants to perform the call), logs in into that server and do some processing...
the process takes about 15 seconds to complete each user has a different setup (server/user/pwd), so the process needs to run against each one
if 1000 users tells the system to run the method at 1:00PM
How can I insure that the method is processed in the next 15 minutes?
What should be the correct approach to this little problem?
I'm thinking that I need to do something Asynchronously, and parallel processing could speed up things, maybe throttling the processes, maybe execute 100 calls per each 30 seconds?
I never did something like this and would love to get your feedback on ideas and future problems just to spend 100 hours of work and realize that I took a wrong road
I have a data grid in which I have to display around 12,000 records. Even if I do paging it is difficult to display all the records. Is there any other control or something else so that I can display all these records. Even if I make these as alphabetical also, some times I have to load 1000 records in a page which is difficult.
I have uploaded the WCAT results run on windows 7, same script, to http://d1yb9lkqglrfzu.cloudfront.net/IISExpress-100VU-MachineConfig.zip ts: included XSL in zip.
1.IIS Express has slighter higher requests per second, and total transactions served than normal IIS.
2.IIS Express is executing up to 100 requests at a time, while normal IIS on windows 7 is limited to 10 as designed.
3.IIS express is using 30% higher cpu, probably because of additional requests it handles at a time.
4.But on average Express requests take much longer to complete..up to 4 times longer. see Request Execution Time performance counter and time analysis (first and last byte). Express is only able to beat IIS in total requests served because it can handle more requests at a time! Theories
1.Could the fact that IIS express is printing each request to command line window even with trace set none be slowing it down.
2.I also noticed a lot of additional modules registered in IIS express applicationhost.config that are not in IIS applicationhost.config. Could then extra debugging/tracing modules be causing the problem.
3.I notice IIS express does not have FileCache and HTTPCache modules. Could that be why?
I am using Linq to SQL. I have a table with a uniqueidentifyer column.
I need to insert 1000 records, each with all the same values except for the uniqueid field.
I know the syntax to insert a single record for example where dc is a DataContext():
[Code]....
Does anyone know how if there is a way, other than looping 1000 times, to tell SQL to insert 1000 records generating different unique ids but assign the constant values to the other columns?
Let's say I am creating a image hosting website. My potential users will be somewhere around 1 Million, and every user potential has 10,000 images, and I need to serve over 1000 images per second.
So, I bought a diskarray, with 10T storage, SAS 15K SCSI drives.
The problem is: What is the best way to save those files on disk? How to organize the folder structure to make sure NTFS can find one file from a billion files under a huge tree folder quickly? I mean, serve 1000 images per second is non trivial issue. My current website is serving over 100 images per second, and I already see the performance problem: NTFS can't find the file fast enough! And of course, my folder structure is not good enough either.
I'm trying to understand how to execute AJAX animation on an asp button that has to execute code on Postback. In other words, I have button with code behind that needs to be excuted, but at the same time want to be able to have one of animation extenders be applied to it. I understand that I need to use the BeginRequest Event, I'm just not sure how, or which javascript commands to use to call the ajax animation so the postback will still occur.
I am looking through a sql stored procedure which I might need to update in the near future. Basically the stored procedure is about 20 lines long. The stored procedure first builds a query
and stores it in a variable named "@Sql". And then for the last two lines of the stored procedure it appears that the big sql statement stored in "@Sql" is executed by using the "EXEC" command. See below. What is confusing though is that the query appears to be exectuted twice? Why was the query written in this way. Don't both lines do the same thing? Why is it being done twice? Could this possibly be a mistake on the part of the person who wrote the query. Below are the two lines I am talking about?
I need to run the HttpContext.Current.Server.Execute method in my ASP.NET application. This application has a WCF operation that does some processing. Currently, I am to do my processing correctly from within my WCF operation. However, I would like to do this asynchronously.
In an error to attempt this asynchronously, I tried running Server.Execute in the DoWork event handler of a BackgroundWorker. Unfortunately, this throws an error that says
"object reference not set to an instance of an object" The HttpContext element is not null. I checked that. It is some property nested in the HttpContext object that appears to be null. However, I have not been able to identify why this won't work. It happens as soon as I move the processing to the BackgroundWorker thread. My question is, how can I asynchronously execute the Server.Execute method?
I have a datagrid control which is bound to a table which containing more than 1000 records. And i want to show only 25 records once a time. I have used paging in datagrid. But each time the next page index is set, query is fired again. This takes lots of time. So what is the easiest way to bound data in this case to improve performance.
In my web application I have a multiview that includes a few datagrids in which the user needs to enter some data. It takes approximately 20 minutes to complete the process, including user registration.
In order to prevent the system to time out before the user ends the process, I added the following to my web.config file: <sessionState mode="InProc" cookieless="false" timeout="120"/> , which according to what I have read, gives 120 minutes before the system times out. However, I get a timeout flag after a few minutes instead of after 120 minute, and all the information the user enters is erased.
I'm trying to track down an issue on an ASP.NET v3.5 application where the HttpSession times out before its (default) 20 minutes. We're seeing behaviour where the session is lost only a few minutes into a session, at random and with no discernible cause such as unhandled exceptions. As far as I can tell, the ASP.NET worker process is not dying, otherwise that would have explained the dropped session.
What approach should I use to monitor when the session is dropped? Is there some event I can listen to, or some other hook in the System.Web namespace? Also, can someone confirm that the countdown to expiration is reset by web activity? That is, the session's lifetime gets reset to the (default) 20 minutes each time the web client makes an HTTP GET or POST?
I have a program which listerns to a specific directory and do some stuff once file is created on that directory. The thing is this works perfectly fine when I run it manually for testing. Meaning that when I copy and paste files in to that directory it work just fine.
Then I test it against our business system and had this problem. When our business system generates a file in that directory event fires 2-3 times and this leads to lof of problems.
One of the test case requirement is to run the same query ie URL for N number of times. Consider a google search that will have a text box and a Search button. I want to search a string such as "Test API" for N number of times. I can't do this test manually because i have to refresh the browser or hitting the button for so many number of times. I know, we will be getting the same results but that will change the page ranking. Is there any script available to automate this test case in C# or any language?
I have a simple asp.net web forms page that does an insert to my sql server db. My server was running slow at the time and I pressed Insert button several times because I didn't think it took but it did all 3 times.So I have duplicates from that one interaction. How would I prevent this?
I have a question that I can't quite find the answer to...
If you have an ASP.Net page that takes longer than the request time-out to render what happens to that process? Does the web service abort it?
Lets say I'm writing XML to the response stream in an ASP.Net page and it times-out calling my GenerateXML method. What happens to my method call? Does it complete but the web server reports the time out? or is it aborted?
I could probably write a test to see my own results but I figure there might be more to it.
I haven't made any code or configuration changes (that I know of) to my ASP.NET web application and this morning it suddenly stopped showing the AM in my displayed times. PM still shows up, just not AM. It's hosted on Windows Server 2003. I figured somehow the OS regional settings might have been changed somehow, but that doesn't appear to be the case. How could this have happened?
I was able to change the OS time format to hh:mm:ss tt and then back to h:mm:ss tt and it seems to have fixed my app. I'm going to assume that the hosting company made some kind of change unless somebody has a better idea