0

Code:

SqlCeCommand addBookHistoryQuery = new SqlCeCommand("INSERT INTO rooms_history (room_id,[user],data_wynajecia,data_zwolnienia,id) VALUES (@room_id, @user, @data_wynajecia, @data_zwolnienia, @id)", connection);

Can anyone remind me what was doing [ ] with parameter? ([user])

Thanks.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

0

Brackets are typically used around names that are reserved keywords in SQL, or to get around special characters. This is a duplicate of What is the use of the square brackets [] in sql statements? though.

Community
  • 1
  • 1
mariocatch
  • 8,305
  • 8
  • 50
  • 71