David Smith

David Smith

  • NA
  • 2k
  • 0

Access SQL Update String Error

Dec 3 2012 9:32 AM
I am not for sure what is wrong with the SQL below. I am getting No value given for the required parameters below. I am using an Access Database.

      string sql = string.Format("UPDATE ApprovedPersonnel SET  @UserName = '{0}', @Login = '{1}', [@Role] = '{2}', @IsActive = {3}, [@Password] = '{4}', @IsEditor = {5},  @UserModified = {6}, @UserNotes = '{7}', @UserModifiedTime = '{8}' " +
                                                                        "Where ID = "+ ID +" ",
                                                                        UserName,
                                                                        Login,
                                                                        Role,
                                                                        IsActive,
                                                                        Password,
                                                                        IsEditor,
                                                                        UserModified.ToShortDateString(),
                                                                        UserNotes,
                                                                        UserModifiedTime                                                              
                                                                        );

Answers (1)