Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

I got this error: "Insufficient security permissions to set the system date"

I Used Today function to get current date and pass the value to Label1.Text in vb.net application.

but in my system don't have admin rights.

Thanks for any help
Posted
Comments
[no name] 22-Jun-11 7:01am    
Explain ur Problem in detail. it seem that u want to change the system date.
Ramanujam Shankar 22-Jun-11 7:05am    
i want to display system date through label control
i used Today function to display the system date to label control
fjdiewornncalwe 22-Jun-11 8:43am    
You should probably show us the code snippet where you retrieve the system date and also where you write the value of the system date to the label1.Text field. If you are only trying to display the date, then you likely have a syntax error there which is attempting to write back to the system date as opposed to just reading it.

You can use below code to show date of Today.

Label1.text = "Date : " & Now.Date


I am using this code in my vs2005 on xp. And it is working.
 
Share this answer
 
Comments
S Houghtelin 22-Jun-11 8:39am    
This does work. Good answer.
Ramanujam Shankar 22-Jun-11 8:43am    
Thanks i will try this solution
Tarun Mangukiya 22-Jun-11 9:21am    
Try this and reply

lblDate.Text = "Date : " & Format(Now, "dd/MM/yyyy")
Ramanujam Shankar 23-Jun-11 1:49am    
Hi Tarun,
thanks a lot i changed the code Now.Date
now it's working fine
Tarun Mangukiya 23-Jun-11 1:53am    
Thanks
You said it yourself: "in my system don't have admin rights" - you need admin rights (and thus an admin account) to set the system date. If you don't have access to one, then you probably can't do it. This may help : MSDN - Insufficient security permissions to set the system date[^]
 
Share this answer
 
v2
Comments
S Houghtelin 22-Jun-11 8:34am    
I hate getting uni-voted just because someone doesn’t like the answer. Your answer explains the reason for the error message.

Also would like to point out to the OP that this does not prevent getting the time, it means you can’t set the time. Which indicates the OP needs to show some code because it appears the code they are using is attempting to set the time. (Meaning, wrong code)

I hope my 5 is enough to compensate.
fjdiewornncalwe 22-Jun-11 8:42am    
As S Houghtelin already says, your answer explains the issue correctly. The answer is correct, whether the univoter likes it or not. (+5)
Previously i used in vb.net application is
Label1.Text = Cstr(Today)
the above line of coding i got the error message like "Insufficient security permissions to set the system date"

Now i changed the code
Label1.Text = Cstr(Now.Date)


It's working fine.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900