New answers tagged

4

Before I begin, I want to call out something really positive. It's great that you're using parameters when reading data from the database; it's very easy to fall into the trap of using plain string concatenation, and there are liable to be severe consequences in doing so. Capitalize public property names in UserDetails Since these are all public properties, ...


2

This: if (UserDetails.accessId == 2 || UserDetails.accessId == 3) Consider using an Enum instead of hardcoding integer values eg: enum AccessLevel : int { None = 0, Manager = 2, SuperUser = 3 } You can use verbatim strings for your SQL statements: string sql = @"SELECT f.id, f.Document_Reference, f.document_name, f.path, f.version, f....


2

Don't use StringBuilder in searchbtn_Click; use a Joined List<string> You're combining a small number of small strings, so there's likely no real performance benefits in using a StringBuilder. I would suggest creating a List<string> and then calling string.Join on the list: var parts = new List<string>(); if (documentName.Text.Length > 0)...


Top 50 recent answers are included