I posted this on the vb.net forum and was told I should post it here.
What I'm trying to do should be simple but it hasn't been for me. I have a page that produces several Crystal reports. It has a button for each type. I use the button's onclick feature to process that particular report.
What I would like to do is show an 'in process' page while the report is processing (some of them take a minute or so) and then come back to the choices page once the report is complete.
If I place the code to make the 'in process' page visible in the onclick, then I don't see the 'in process' page until the report is completed. I've tried setting a session variable and redirecting back to the page and haven't been successful.
Here is the html:
[Code]....
I know I can simply call another page (like I did in the old asp app) but I shouldn't have to do that in .net.
Want to display staus of long process. when user click on button calling some function which will return the percentage of work done .I want to display that persentage in some where in the page.How can i do it?
1. Assigning text of a few lables to corresponding variables. 2. Taking/posting these variables to server and process them. 3. Print the outcome in a message.
An example would be: Take lable1 as variable x. Take lable2 as variable y. then process as z=x+y. and print z on the page.
If I watch the processes tab in Task Manager on the web server I see "cmd.exe" under the context of 'administrator' but it just hangs. For test purposes c:SendV80s.bat: copy c: oot.ini c:zzz.txt
If I logon onto the webserver's console and execute SendV80s.bat it works and exits without issue. But when I execute the same batch file via the Submit button it gets stuck executing in Task Manager/Process. I believe this has something to do with the fact that cmd is not running in a full environment/desktop context. I just noticed this on the actual console of the webserver (not in my RDP console but console 0 instead)
A pop-up box stating: CMD.exe Application error The application failed to initialize properly (0xc0000142). Click OK to terminate the application. And when I click on the OK button my ASPX page's WaitForExit is satisfied and the continues processing normally.
I know that similar questions have been asked all over the place, but I'm having trouble finding one that relates directly to what I'm after.
I have a website where a user uploads a data file, then that file is transformed and imported into SQL. The file could be up to 50mb in size, and some times this process can take 30 minutes or sometimes even longer.
I realise I need to palm off the actual work to another process, and poll that process on the web page. I'm wondering what the best approach would be though? Being a web developer by trade, I'm finding all this new Windows Service stuff a bit confusing, and I just wanted somewhere to start.
So:
Can I do / should I being doing this with a windows service? if so, how?
Should I use WCF? If this runs under IIS, will I have problems with aspnet_wp.exe recycling and timing out my process?
clarifications
The data is imported into sql, there's no file distribution taking place.
If there is a failure, it absolutely MUST be reported to the user. The web page will poll every, lets say, 5 seconds, from the time the async task begins, to get the 'status' of the import. Once it's finished another response will tell the page to stop polling for status updates.
queries on final decision
ok, so as I thought, it seems that a windows service is the best idea. So as to HOW to get it to work, it seems the 'put the file there and wait for the service to pick it up' idea is the generally accepted way, is there a way I can start a process run by the service, without it having to constantly be checking a database table / folder? As I said earlier, I don't have any experience with Windows Services - I wondered if I put a public method in the service, can I call it somehow?
I keep receiving an exception with the message "Logon failure: unknown user name or bad password". Im absolutelly sure that i'm submiting my correct username/pwd
I've developed a popup email .aspx used on our intranet based web app that is auto generated with .pdf's attached. I'm developing with VS 2008 ASP.Net 3.5 C# and System.Net.Mail.MailMessage. I can create and send the email with no issues. The problem is with any attempt to open or delete the attachments I get the above error. The .pdf's a copied with the following code:
FileStream fsr = new FileStream(inFilename, FileMode.Open, FileAccess.Read, FileShare.Read); BinaryReader reader = new BinaryReader(fsr); byte[] bytes = new byte[fsr.Length]; reader.Read(bytes, 0, bytes.Length); FileStream fsw = new FileStream(outFileName, FileMode.Create, FileAccess.Write, FileShare.Write); BinaryWriter writer = new BinaryWriter(fsw); writer.Write(bytes, 0, bytes.Length); // clean up writer.Flush(); writer.Close(); writer = null; fsw.Close(); fsw.Dispose(); fsw = null; reader.Close(); reader = null; fsr.Close(); fsr.Dispose(); fsr = null; Later after sending the email I: mailMessage.Dispose(); mailMessage = null; foreach (string fileName in attachments) { if (File.Exists(fileName)) File.Delete(fileName); }
The error occurs at: the File.Delete(fileName);
how I can delete or reopen these files after sending the email?
I have a .NET infra code running both within the IIS worker process and within a desktop client app. How can the .NET code determine whether it is running within an IIS worker process?
I know that I could check the name of the process (w3wp.exe, for instance), but I would like a more robust approach. I wish to make a side note. This is not a production need. I need this information to enable certain scenarios useful during the development and testing phase. Specifically to ease the testing of secure vs non secure configurations.
When I hit the run button (in my Default.aspx), a process starts (this process contacts a webservice to get some files, etc). How do I: Ensure that only a single process is running at a time (i.e. if I refresh the browser, I don't want to start the process a second time)Track progress - there are 4 points of the process (at 25%, 50%, 75%, 100%) that I want to track, and when each part completes, I want to update the progress bar. I have a status object for the running process, but the question is how to update the progress bar automatically? Do I need to use threads to achieve the above two?
My code is that I want to create a log file and log it upon a new user browsing the site. However, what i did was I put in a 6 second delay and then used another browser to access the page. And it threw an Exception saying it is being used by another process which is true. So how come I set it so that, if IT is being used by another process, WAIT and retry every 500 milliseconds until it becomes free/available?
here's the code:
protected void Page_Load(object sender, EventArgs e) {if (!IsPostBack) // if this is the first time page loads, set k to 1 { lognewuser(); }}
I am having the text file which is used to track all the ip address which is available in the network and replace the content from"Reply from 172.29.116.3: bytes=32 time=1ms TTL=255" to 172.29.116.3.
For this task i am having 2 functions 1.runCMD() Function is used to create a file which ping all the ip address between 3 to 254 ("Reply from 172.29.116.3: bytes=32 time=1ms TTL=255").
2.Another function textFileReplace() which is used to replace the text from "Reply from 172.29.116.3: bytes=32 time=1ms TTL=255" to 172.29.116.3.
This process will continue every 30 minutes..
But i am having the error while accessing the function textFileReplace() as The process cannot access the file 'C:inetpub' because it is being used by another process.
i hit a case when my page loading is very very slow. I have find out that my page is slow for no reason. The read data process from database is fast and all the server code execute quite fast. The problem is the page loading process is slow, very slow. I am thinking one of the possible cause is jquery itself.
I need to get a certain web page, process the data a bit and do a db search or two.I hope my subjectline is clear enough. I load some data from an database with wep GUI. But there are character set problems with the data, and I have to fix those, before the data gets mangled by the IE. And I cant fix the source database or web page.
The question is exactly as the title sounds. I have 1 master page in asp.net(vb.net). now this master page has 1 form which has 10 textboxes in it. On the other hand the master page has about 10 different links in it (outside the form), that link to different pages. My question is how do i keep all this same way, and only divide the form in 2 pages. 5 textboxes for first and 5 textboxes for second. So basically when master page loads, it doesnt show the 10 textboxes as original, but shows only first 5, and when clicked "continue", the next 5 textboxes load on the same place as the first 5 were. The rest of links in page and rest of the page, remains exactly the same.
I am using CreateUserWizard control.. Is there anyway, I can put all the steps in the wizard process into one page. I do not like the idea of sifting through multiple pages to create a user. I would like one page where user goes through different sections (panels/divs) and creates a user ultimately all from one page.
I have a web page hosted on the server and a zip file on the server's file system. The page is spinning off the 7zip process with some arguments (location of the zip file and destination folder for unzipping) but it seems to raise permission issues, of course. For each file in the archive I get "Can not open file [filename]". I tried windows authentication and running the process with a username and password but nothing worked properly. What would be the best way for unzipping the file on the server from security point of view? Ideally, I would also like to have this event driven so the file is unzipped as soon as it arrives on the server (this is when I request the page).
I have a stored procedure which fetches data after joining 8-9 tables and inserts that into a temp table. It was running fine till now, but now when the amount of data fetched have exceeded 20000, the SP is breaking. I have debugged the sp and found that this main query is failing after returning arround 15000-16000 records.
The error message says Transaction (Process ID) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. I know what is deadlock, but when i checked with SP_LOCK stored proc i only found that my process is running on database only. So how is this getting deadlocked when there are no other processes running simultaneously on server.
When I delete all files from the directory path. then it will give me this error The process cannot access the file because it is being used by another process. How to solve this?
I am getting binary data from a SQL Server database field and am creating a document locally in a directory my application has permissions. However I am still getting the error specified in the title. I have tried numerous suggestions posted on the web including those suggested in previous posts on Stackoverflow. I have also used ProcessExplorer > Find Handle to locate the lock and it returns nothing as if the file is not locked.
I am using the code below to save the file to the file system and I then try to copy this file to a new location later in the application process within another method. It is this copy method that takes the path of the newly created file that throws the exception.
The file itself is created with its content and i can open it through Windows Explorer without any problems.
Am I missing something completely obvious? Am I creating the file correctly from the database?
// Get file from DB FileStream fs = new FileStream( "C:myTempDirectorymyFile.doc", FileMode.OpenOrCreate, FileAccess.Write); BinaryWriter br = new BinaryWriter(fs); br.Write("BinaryDataFromDB"); fs.Flush(); fs.Close(); fs.Dispose(); // Copy file File.Copy(sourceFileName, destinationFilename, true);