Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
T

Tehnoon

@Tehnoon
About
Posts
8
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Windows Service Stop working
    T Tehnoon

    I ran into this problem once, and never got to solve it. It has something to do with a timer being used in a windows service which is running on Windows Server 2003. What happens is that randomly, the timer events stop getting fired. I had to write my own timer then to get around this problem. By the way, some people do report that they got the problem solved by using the System.Threading.Timer class instead of System.Timers.Timer. So if you are using System.Timers.Timer, try using System.Threading.Timer first.

    C#

  • Write to a file in ASCII format
    T Tehnoon

    If you use Convert.ToChar(48), it will return you '1', and so forth. :-D

    C#

  • Exception: Array index out of bounds
    T Tehnoon

    There is a very obvious mistake that you are making here. The query myQuery is returning you only one column per row. You are using dataReader.GetTime(1) , which is trying to get the second column (indexes are zero based, not 1 based) and hence generating an index out of range exception, because there is nothing at the "1" ordinal. Solution: Change the line classStartTime = dataReader.GetTime(1).ToString(); to classStartTime = dataReader.GetTime(0).ToString();

    C# csharp database data-structures question

  • About EndInvoke
    T Tehnoon

    Can you show the code in which you are invoking the thread which is creating the problem? Garbage collection will not be done unless the thread is finished with the execution. The only possibility that I am seeing here is that the system is not being able to provide all the requested resources by the program and hence the results are not coming out as expected. A look at the source code will give me a better idea of this.

    C# help question

  • About EndInvoke
    T Tehnoon

    Rest assured. EndInvoke is ONLYused if your asyncronous method returns something. You call EndInvoke to retrieve that return value, since you can't get the return value in any other way. EndInvoke does not do anything else apart from giving you the return value. If you are not interested in the return value, you do not need to call EndInvoke. I have used BeginInvoke so many times in so many performance critical applications without using EndInvoke, it doesn't create a problem

    C# help question

  • Thread Synchronization program
    T Tehnoon

    Lots of problems in here. 1. Why are you using lock(lockObject), when lockObject is not being modified or even used by any thread at all!!! If you want to allow one thread at a time to modify your Array List, you should use lock(list). 2. In the code: int x = rand.Next(1, list.Count); list.Remove(x); You are assuming that x is always present in the list. Whereas it is a possibility that x might have been removed by any other thread. Instead of removing the actual entry, you should use the indexes by using RemoveAt, and the number should not be x, it should be list[x]. 3. The code written in the function will only execute five times, once per thread. So the list of 1000 will not get exhausted with this. You should use a loop to iterate through the list.

    C# tutorial question announcement lounge

  • How to reach the (Name) property
    T Tehnoon

    If you drag and drop a button with the name button1, you can programmatically access its id or name by using the button1.Name property. It's not that difficult :-);P

    C# json tutorial question

  • How to show .CHM files in C#?
    T Tehnoon

    Hello Abhijeet Your description of the problem is perhaps not complete. Are you devleoping a Web or a Windows Application, what method are you using to display and load the .chm file? Assuming that you are working on a Windows application and you are using the Helpprovider extender provider to load the display the .chm file, in the design mode, you have to specify then name of the chm file which you want to load when the user presses the F1 button in the 'HelpNamespce' property of the extender provider. There is a browse button against that property which allows you to specify the path of your chm file. If you use the browse button, it hard codes the physical file of the path in that property, so that when you run the application from the VS IDE, it works fine, but if you build and deploy the project, it would search for the chm file at the same physical path as that on your development machine, and hence doesnt find it. The Solution: In development environment/machine, remove the physical path of the chm file from the HelpNamespace property of the help provider and leave only the name of the file along with the .chm extension. Now copy the .chm file in the folder [ProjectName]\Bin\Debug (The same folder where the .exe file of your project is). Run and verify that the chm file is still being located. When deploying, make sure that the exe file of your project and the chm file are in the same folder. This should solve the problem.

    C# help csharp tutorial question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups