Hot answers tagged

21 votes
Accepted

Don't search for minors, it isn't allowed

This part of the review is focused on the Javascript aspect of the answer I will be really light on this review. I will try to make it short and quick. You have some mixed quotes. Consider the ...
user avatar
13 votes
Accepted

Username, Password and UserType Validation

Here are some observations: you first iterate all rows in Credentials and then select the Password yet again - why not just select the pasword? seems like your ...
user avatar
13 votes

C# Am I using proper SOLID principles?

I suppose the simplest thing is to go through the principles: SRP - Cannot see any 'too big' things in your example OCP - The example is small enough and you are not using class inheritance that I ...
user avatar
12 votes

ASP.Net caching manager

...
user avatar
11 votes
Accepted

How to Make Strongly-typed References to Web.Config?

I don't do much asp.net, but if this StackOverflow answer applies then you could just do this: ...
user avatar
10 votes
Accepted

Tracking sports statistics

Don't use underscores in identifiers. If that's how the database has them, use a ColumnAttribute to specify the column name scratch that, you're going code-first. ...
user avatar
10 votes
Accepted

Converting multiple query to use parameters to avoid SQL injection

The recommended way to avoid SQL injection attacks is to use parameters. Also I can recommend that you create a stored procedure instead of using dynamic SQL. You can pass your dropdown indexes as ...
user avatar
  • 248
10 votes
Accepted

Simple Google ReCaptcha validation

private readonly string _ReCaptchaSecret; private readonly string _ReCaptchaSiteKey; private fields are either ...
user avatar
9 votes

ASP.Net caching manager

...
user avatar
9 votes

Tracking sports statistics

I made a small example to show you that all your worries are in the past. Before you implement this yourself though, keep Mat's remarks in mind: I made this as a quick sketch and separating the ...
user avatar
9 votes

Username, Password and UserType Validation

...
user avatar
  • 25k
8 votes
Accepted

Using properties efficiently in inheritance

Accessors in C# You should read on accessors in C# - your setter does not do what it should - it should set the value if Cname. If this has no meaning (you can't ...
user avatar
  • 6,557
8 votes

Truncate port number from absolute Uri

I have witnessed the UriBuilder .port = -1 fix elsewhere. Frankly guys, it is a hack that really isn't a good production ready solution. The right solution here is to use UriBuilder as follows. <...
user avatar
8 votes

ASP.Net caching manager

I would suggest one more solution how to make usage a bit easier. You can add this method into CacheHelper ...
user avatar
8 votes

Sending GET/POST requests in .NET

First off your methods are not extension methods as the name RequestsExtensions would indicate. Not sure if this intentional or. If you want to make them true ...
user avatar
  • 20k
8 votes

Validate and Add Service Provider/Location in C#

There are five lines that are repeated three times: ...
user avatar
  • 10.6k
7 votes
Accepted

Can my code be made into one?

Per the comment, what you probably want is an abstract class MyAppPage: ...
user avatar
  • 186
7 votes

Generic ASP.NET MVC controller that generates many pages

This switch should be an if statement instead. ...
user avatar
  • 28.5k
7 votes
Accepted

Should I split code into smaller functions? Advice on layout

I would basically write a method wherever you've written a comment on what a block of code does. This allows you to hide the specifics of a particular operation and makes it clearer which code paths ...
user avatar
7 votes
Accepted

Searching through various PDF files

The major bottleneck is most likely in the ReadPdfFile method as we are dealing with a PDF file. In your ...
user avatar
  • 3,096
7 votes
Accepted

Displaying a row of buttons

This can be shortened up quite a bit. First, you have presentation logic intertwined in your ASP code, which is the main cause for the code repetition. Shortening this code and DRY-ing it up involves ...
user avatar
7 votes
Accepted

Educational website using ASP.NET webforms

...
user avatar
7 votes
Accepted

Audit table queries for various combinations of search criteria

First of all you should remove duplication. It's clearly that every if..else block has same code for filling DataTable and binding it to ListView. Move it to the bottom: ...
user avatar
7 votes

Combating magic strings in a web application

First point, these extensions are really cool. I don't have much comments to give, your code looks pretty good! The ActionInfo class could be simplified a little :...
user avatar
  • 12.2k
7 votes
Accepted

ASP controller for tracking equipment

Index It would appear you primarily do three things here. Sort, Filter, and Page. There's not much to say about your paging, but the sorting and filtering logic clutter the action. Try creating an ...
user avatar
  • 1,960
7 votes
Accepted

C# Convert BLOB to jpg, resize, then back to BLOB

Welcome to CodeReview! I hope you get some good feedback. Absolute paths ...
user avatar
  • 47.7k
6 votes

Tracking sports statistics

I suggest to use the same name for primary and foreign keys following some consistent pattern: It could be e.g. _id or Id, so you will have in PlayerAccount table the primary key PlayerAccountId (...
user avatar
6 votes

Database connection approach

As @chrfin mentioned, this type of question is best suited for CodeReview. This is the wrong way to use connections. Keeping a connection open indefinetely is bad because it accumulates locks, ...
user avatar
6 votes

Calling many web services asynchronously

I'm not all that familiar with async/await (I really need to get going on this), but I find your code pretty clear, except why ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible