Updating Datetime field in sql server database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sunil Tripathi
    New Member
    • Mar 2012
    • 1

    Updating Datetime field in sql server database

    I am working C#.net. I have a datetime variable 'currDate' whose value is set to current date. when i fire an update query as
    Code:
    Update UserLogin set Date=currDate where UserId='"+txtUserName.text+"';
    i get an error 'cannot update column currDate '.how should i go about it.
    Last edited by NeoPa; Mar 25 '12, 10:12 PM. Reason: Added mandatory [CODE] tags for you
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Are you updating a variable or a column? Are Date and currDate both a column? If one them is a variable, you have mto adjust your syntax.

    Happy Coding!!!


    ~~ CK

    Comment

    Working...