sometimes port is available while sometimes not!

hello every 1. most of the time when i connect my board (arduino uno) to my pc it connects to it while sometimes it doesnt.what happens is the led of arduino(power-which flashes when power is supplied to it) initaily glows for a second or two but gradually the brightness starts to decrease and when i try to upload my code the error shows as com3 port is not avialble. pls help, i dont know how this happens as sometimes this happens while sometimes not all i want is that this never happens again.

Does this happen with NOTHING else connected to the board as that is your starting point for any tests.

You also need to tell us a lot more about your computer...type of USB ports, OS, Other hardware eg USB hubs, serial devices etc etc.

Take a look here as to the types of information that will help you get a better answer.