|
Okay. That didn't work either. I wonder if I must re-code the project pretty much from scratch. :-P
|
|
|
|
|
have you tried another PC? another Visual?
either something in your system is broken (outside your app), or your code does something that (sometimes) fails, but then the cause should be visible in the source files. I haven't seen your code, I can't tell, but you should be able to.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Okay, I built the project in Release mode and ran it in the debugger. Success. Running it from the \Release folder, however, was a failure. Now running it from the \Debug folder won't work either.
|
|
|
|
|
So I have a dictionary with DayofWeek and Int.
I need to find out how to populate the Dictionary then with the Days and and integer increase.
for example right now I create a dictionary:
Dictionary<int,DayOfWeek> dicFindDates = new Dictionary<int,DayOfWeek>();
then I get the day of week it is for example today is "Thursday"
DayOfWeek dowStartDay = (DayOfWeek)Enum.ToObject(typeof(DayOfWeek), (int)S.StartOfWeek);
then I add to the dictionary
dicFindDates.Add(0,DayofWeek)
while (i<6)
{
dicFindDates.Add(i++,DayofWeek <------ ++????)
}
so that I get(and can change according to date):
0, Thursday
1, Friday
2, Saturday
3, Sunday
4, Monday
5, Tuesday
6, Wednesday
|
|
|
|
|
Hi,
(DayOfWeek)i should do it.
[Added]
Which also implies you don't really need a dictionary at all...
[/Added]
BTW: I recommend you use a for loop, rather than an auto-increment in the middle of a statement. And you can handle all seven days in the same way, no need to treat 0 separately.
FWIW: I have some goodies about DateTime in this article[^].
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
modified on Thursday, May 20, 2010 2:41 PM
|
|
|
|
|
I am generating a zip file and then emailing it. I am using a temp directory to create this file but i will always be creating a number of different files using this directory.
The problem i am having is when i go to delete the files inside my temp directory i get an error saying that the zip file is being used by another process.
I have stepped through the code and waited until the email was sent to be sure that its not being locked there.
I have also set the zipfile to null and that still didnt work.
if anyone has any ideas as to what might be causing this i would be forever grateful.
if (!CreatedTempFolder)
{
if (!System.IO.Directory.Exists(TempFileLocation))
System.IO.Directory.CreateDirectory(TempFileLocation);
else
{
System.IO.Directory.Delete(TempFileLocation, true);
System.IO.Directory.CreateDirectory(TempFileLocation);
}
string zipFileName = string.Format("{0}\\{1}.zip", TempFileLocation, DrSched["GROUPNAME"].ToString());
MyZip zipfile = new MyZip(zipFileName,"W");
foreach (string fileName in System.IO.Directory.GetFiles(TempFileLocation,"*.csv"))
zipfile.AddFile(fileName);
zipfile.Close();
zipfile = null;
GC.Collect();
|
|
|
|
|
If MyZip implements IDisposable (which Im willing to bet it does!) then you need to call Dispose() on it.
Setting it to null does nothing to solve the problem you're experiencing.
|
|
|
|
|
You haven't stated what zipFile is (build in .Net functionality? sharpZipLib? Other third party?) however I suspect the problem is you need to call Dispose as well as Close , so that it releases unmanaged resources, in this case the underlying file.
|
|
|
|
|
Thanks for your help i have found a work around from this i am still not 100% sure exactly what MyZip(its company specific).
Thanks for all your help !!!
Dino
|
|
|
|
|
If you are targeting .NET 3.5 or even 4.0 there is a namespace called System.IO.Packaging , which contains some classes that allow working with zip files.
Life is a stage and we are all actors!
|
|
|
|
|
Anybody know of a .net based (ideally C#) .mov (video format) file writer? If not, can anybody point me to a DLL I can use for this?
Thanks,
Chris
|
|
|
|
|
The best I can suggest is to try using ffmpeg called from within .net (http://www.ffmpeg.org/[^]).
It won't be pretty or particularly secure.
|
|
|
|
|
Thanks for the suggestion - looks a bit tricky to use from .Net, but beggars can't be choosy.
|
|
|
|
|
I am working on an application where i need to retrieve data (using query) from a Access database.(ABC.mdb)
Please provide code snippet for this.
it is helpful if you can provide sample which uses dataset .
|
|
|
|
|
|
Did you check on msdn - see here.
My signature "sucks" today
|
|
|
|
|
Thnx..
As shown in the example dataset contain data table information. Now i need to retrieve some set of data from dataset. How to do it.
Can we fire quire on the data available in the dataset.
|
|
|
|
|
Chiman1 wrote: data available in the dataset
So change the query to get the information that you want to get.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
Hi everyone, I am little confused about VSC++ header file and class. I am converting a project from VSC++ to C#. In VSC++ I have a header file, since it is a windows application, accessed throughout the application from many different forms. Now I want to have class or codefile does something like that. I do not have much idea how to that exactly.
thanks
|
|
|
|
|
Header files were features that allowed the C/C++ compiler determine what methods a class/file would contain. They didn't necessarily contain any implementation (although some did), but they were included in another file/application using #include so that this could use those methods.
There's no need to do this in .NET. All you need do is add a reference to the DLL that contains the functionality you want to use, add a using statement for the relevant namespace and you have access to all the public methods that class exposes (if your class inherits from it, you get access to the protected methods as well).
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hello Pete O'Hanlon, Thanks for your reply. Now I know were I am. I will go with .dll this is fine with me.
thanks again.
|
|
|
|
|
Pete O'Hanlon wrote: add a using statement
That is not a requirement -- it's a sign of weakness.
|
|
|
|
|
I agree with Pete, of course.
I would like to add my suggestion to buy a book on C# and study it. It is the most effective and efficient way to learn the language; experimenting is fine, and necessary, but by itself it is no guarantee to becoming a good and productive C# programmer.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Hello Luc Pattyn, I could not agree more with you. I believe in teaching someone how to catch fish not catching for them.
I have question to you since you have worked on embedded system. I am currently working on windows CE 6.0. I already build the OS. Now I had a application written in VSC++ for desktop. I need to convert it to C# and deploy it on window CE platform( create a smart device application from scratch ). Do you have any suggestion for me besides reading a book (I will read any book necessary regardless).
|
|
|
|
|
Sorry, the embedded systems I work with aren't using any Windows. Nor C#.
I do a lot of C# on desktop Windows though.
For C# you will need some .NET framework, probably the .NET Compact Framework 2.0 or 3.5
You could:
- keep some C/C++ code and use P/Invoke to let C# access it; I do it often on Windows XP/Vista, I understand P/Invoke on WinCE/Compact.NET is somewhat crippled. I have a general article in the works here[^], it contains a link (near the end) to the compact version of P/Invoke.
- convert your C/C++ code to managed C++; I would advise against that, the managed C++/CLI isn't all that popular and quite different from unmanaged C/C++.
- do everything in C#; that would be the recommended way, unless you need functionality that isn't present in the framework.
As for conversion itself, depending on size (and the number of authors), I would do it by hand.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|