check Table status...

Can anyone tell me how do I check my table status wheather is
writelock or readlock ? please give me the coding if you can

thanks