Search code examples
vb.netms-accessvisual-studio-2015dapper

how to use reserved words in an access database with dapper in VB.NET


how to use reserved words in an access database with dapper in VB.NET? I want to use "name" if there is a solution without changing the name in the field in the access database.

Thanks

              Con.Execute($"Update Users Set name = name,email = @email,phone = @phone,password = @password Where id = @id", New With {
                    Key .name = bunifuTextBox1.Text,
                    Key .email = txtEmail.Text,
                    Key .phone = bunifuTextBox2.Text,
                    Key .password = txtPassword.Text,
                    Key .id = id
                })

Solution

  • Use brackets:

    Con.Execute($"Update Users Set [name] = @name, email = @email, phone = @phone, [password] = @password Where id = @id", ...