That's most probably the culprit. This "UniqueIdentifier" is not a string and apparently your database engine cannot convert it implicitly. Try to follow Richard Deeming's advice. Alternatively you could use a parametrized query instead and try to pass the guid as a byte (blob) instead of a string.
I've implemented a progress bar to my application but it makes the file copy process painfully slow whereas without the progress bar the copy is very fast. I know without the progress bar it only takes a few seconds to copy a 10 megabyte file but with the progress bar it takes more than a minute. What am I doing wrong?
Not only are you copying the file in the UI, you are updating the progress bar every IO. I always calculate percent complete using the following formula: (number of bytes copied * 100) / size of file in bytes All numbers used in the calculation are long but the result is converted to int. Update the progress bar only when the percent changes.
Hmm OK that makes some sense, but why would copying it inside the UI make any difference? Without the progress bar the files copy very fast, almost instantly. I don't really understand, I guess. Is the progress bar really that resource intensive?
As you said, the progress bar slows down the copy. The progress bar is CPU intensive while the file copy is most likely IO bound. The progress bar slows the copy when the two operations share the same thread. Copying the file in a separate thread will allow more efficient use of multiple processors; both operations run almost independently. Also, try copying a file several gigabytes in size and watch your UI lock up. I tend to reuse code a lot. Code a process right the first time and use it many times.
The main objective is to compress the files into a container, but I want to at least be able to copy files with some type of progress notification at the very least first before I start making an algorithm for compression. Thanks for the source I'll study it and try to make something work.
Sir first of all Great Job and work done from your side.
Sir I want to learn C# at the professional level. I started working on your code (ME). I want to change the code and want to extend it (extend just for learning nothing else). I want to copy the equations directly just by selecting it. Can you please guide me that how can I copy directly my written equations in your ME?
(In step one I want to enable the copy feature and then in step two I want to add a functionality in the export menu to add "Export to Word").
How best can I create a Windows Form Application that regulates temperature and humidity for a green house using C#? I would want the inputs of humidity and temperature to be continuously generated. Please assist.