David Smith

David Smith

  • NA
  • 2k
  • 0

INSERT SQL ERROR C# Access Database

Dec 1 2012 11:24 PM
Can somebody tell me whats wrong with my sql command below. I am getting an syntax error below

                                                      string UserName,
                                                        string Login,
                                                        string Role,
                                                        bool? IsActive,
                                                        string Password,
                                                        bool? IsEditor,
                                                        DateTime UserCreated,
                                                        DateTime UserModified,
                                                        string UserNotes

    string sql = string.Format("INSERT INTO usertable ( UserName, Login, Role, IsActive, Password, IsEditor, UserCreated, UserModified, UserNotes ) " +
                                                                            "VALUES ( '{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}', '{8}' ); ",
                                                                            UserName,
                                                                            Login,
                                                                            Role,
                                                                            IsActive,
                                                                            Password,
                                                                            IsEditor,
                                                                            UserCreated,
                                                                            UserModified,
                                                                            UserNotes
                                                                            );


Answers (1)