|
Don't think you can the way you want.
I think the best you will be able to achieve is to report a progress value in between each step of the sql stuff, i.e.
report progress
open connection
report progress
run command
report progress
close connection
report progress
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
No, it won't be a good thing to do it. Because much of the time takes for the connection itself and retrieving the data (the query)
|
|
|
|
|
Yes, I know that's where the time is mostly spent. But like I said, you cant get the progress of either the connection or the query so my suggestion is about the best you can get.
What you have to consider is that to calculate a progress bar correctly you need to know the total value (i.e. total time, total length of data etc.). When you are doing things that require a network connection then many things can cause the connection to speed up or slow down thus making it impossible to get a precise total time. Of Course, Microsoft could have implement some guestimate functionality or something to do with the data being Sent/Received but AFAIK they didn't and the best you can do is wait for the connection to return a result.
Personal, in your instance, I would use a continuous style for the progress bar, then when the data is pulled of either set the bar to 100% complete, or show the progress of whatever you do with each row pulled back from the data.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
There is no way to show the real progress. All you can do is to work with asynchronous methods (BeginExecuteNonQuery[^] , BeginExecuteReader[^]) and show a marquee style progress bar. Stop the progress bar when you get the notification that asynchronous method is finished.
|
|
|
|
|
Or run the query in a different thread while you show a progressbar whose value is incremented every second using a timer.
You can set the bar's max value to the approximate number of seconds your query will take on average.
That's how most apps behave when they can't know the time an operation will take.
2+2=5 for very large amounts of 2
(always loved that one hehe!)
|
|
|
|
|
Moreno Airoldi wrote: a progressbar whose value is incremented every second
That is actually called a "let us hope the other thread is still working on this, however I am not really sure any progress is being made, all I know is the clock is ticking"-bar.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Exactly hehe!
But seriously, if you implement a timeout check (and you MUST do that when you use this kind of worker threads), this solution works just fine.
2+2=5 for very large amounts of 2
(always loved that one hehe!)
|
|
|
|
|
Like Navaneeth has said, there is no way of knowing how long the connection will take, sometimes it takes a split second so showing a progressbar for that is a bit overkill I would say. As for the collection of the data I would impliment a Marquee style progressBar. This will just scroll untill you stop it when the data has been retreived from the DB.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
yeah i'd do what musefan said, that's the approach i took when i wanted a thorough report for the connection/collection of the data
|
|
|
|
|
Hey all
I have created a setup of my application now my requirement is to run another setup when my application's setup is completed as it wont allow me to run setup during installtion of my application dats why i can't add any thing in commit custom action.
I've spent 3 days to search anything but coudn't find any if you guys have any idea how to do that please tell me.
Thanx in advance
|
|
|
|
|
if you want to run an executable from code you could use...
System.Diagnostics.Process.Start("MyEXE.exe");
Now I have helped you, maybe you could come knocking at my door a little later than scheduled?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
i think you didn't get it the problem is i wanna add a custom action that should run after the installation of my set up is completed i know how to run an exe or setup from code it just dont allow you to run any setup during the installation of you application.
|
|
|
|
|
Ya, this is one of the drwa backs of using MSI's.
I resolved this using a batch file which calls the executable once the setup is completed.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
This might help: MSILaunch[^]
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
Hi
I couldn't find any TESTING forum so using this to post.
I am using Nunit GUI test runner (version 2.4.5) for running almost 1000 tests written using C#. It runs completely and give me results in the end.
Now, there are some failed tests which if I run them in Visual studio directly, they work fine. And GUI log window doesn't say much about why tests failed.
Why could these tests be failing? Is there a way to find out? More logging, maybe. But what should I be logging?
Please advise. Thanks
Pankaj
|
|
|
|
|
pankazmittal wrote: I couldn't find any TESTING forum so using this to post.
this[^] one comes to mind
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
too fast!
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
yeah, strange that... you see I was just writing a template reply in case anyone was posting here as they couldn't find a testing forum then just as I wrote it <BANG!> someone has that very problem... Spooky
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
It's not in the drop down list and the last option "All Message Boards" probably skipped from my eyes. I should have looked deeper.
Thanks
|
|
|
|
|
pankazmittal wrote: Now, there are some failed tests which if I run them in Visual studio directly
Sometimes you can have hidden dependencies between tests such that you can run them all you get some failures but if you run them in isolation they pass. What happens if you run those tests individually in the NUnit GUI? Do they pass or do they still fail?
How are you running them when inside VS? Are you using TestDriven.net or similar?
You might want to examine the state of your test fixture before and after running each test.
Kevin
|
|
|
|
|
I am using Resharper plugin inside Visual Studio. I think I have all dependenies copied over. Not sure about the TextFixture state. Will try to find something on that.
Thanks ..
|
|
|
|
|
I too have run into the problem you describe in the past. It turned out to be my own mistakes. It's likely that one or more tests are not leaving the test fixture class in a clean state, such that a subsequent test(s) fails. But if you run a test in isolation you're always starting from a clean state so it may pass.
Btw, that ReSharper unit test plugin is pretty good. Unfortunately, I'm not a ReSharper user so I have to make use of their old free Unit Test Run 1.0 which they've now discontinued. It's a bit flaky but it works.
Kevin
|
|
|
|
|
yes! it does run in isolation. must be something I am missing. gotta find it.
and yes! resharper is very very cool. Before we got the license I use to run it's 30 day trial. Uninstall it and run it again. Not sure if that still works though. It becomes pain though after a while. But this tool really makes loads of difference.
|
|
|
|
|
I've used ReSharper briefly in the past but I'm currently in the CodeRush/Refactor! camp (actually really just Refactor!). ReSharper is more widely used though. The impression I get is that ReSharper is better at general code analysis and unit testing (CodeRush has only recently started doing this). CodeRush/Refactor! is stronger on refactoring (I think). But anyway both tools are good, though both periodically run into performance problems.
Kevin
|
|
|
|
|
After reading your views about codeRush, I wanted to check it out. Guess what I found... A free license of CodeRush/Refactor.
I still have to form my opinion on this product for thought you may like free stuff.
Get it at http://msdn.microsoft.com/en-us/vcsharp/dd218053.aspx and Enjoy!
|
|
|
|