On the Lambda

Programming, Technology, and Systems Administration

On the Lambda

Entries Tagged as '.net'

Let’s Make a Single Statement Mode for ADO.NET

September 5th, 2022 · No Comments · .net, security, sql, Sql Server, stackoverflow

One of the issues I see often in code on Stack Overflow is SQL injection. I still typically answer multiple questions per week that include, along with the rest of answer, some form of the text, “This is scary-vulnerable to SQL injection issues.” This is a “Really Big Deal”™. It’s one of about three things […]

[Read more →]

Tags:

Indexing a CSV file with .Net

November 28th, 2018 · No Comments · .net, stackoverflow

I recently answered a Stack Overflow question, where I supplied what I believe may be a useful tool for indexing simple CSV data where you might not want to hold the entire data set in memory. I wanted to list it here, because I added the solution that supports CSV as an afterthought; the question […]

[Read more →]

Tags:

The Missing DHCP snap-in for Windows 10 Remote Server Administration Tools

November 6th, 2015 · 4 Comments · .net, c#, development, networking, Powershell, servers

If you’re used to managing Windows Servers, you’re likely familiar with the Windows Server Remote Administration Tools. These tools are packaged as a download for each client (not server) version of Windows. They provide the same set of MMC snap-ins you’ll find on a server, such as Active Directory Users and Computers, DNS, or Group […]

[Read more →]

Tags:

There are worse things than Exceptions

October 21st, 2014 · No Comments · .net, c#, development, stackoverflow

A piece of advise I’ve given on Stack Overflow more than once is to avoid the File.Exists() method, and others like it. Instead, I’ll tell people to just use a try/catch block, and put their time into writing a good exception handler. I won’t re-hash the reasoning here, as I’ve already covered it before. One of those […]

[Read more →]

Tags:

Can we stop using AddWithValue() already?

May 12th, 2014 · 13 Comments · .net, c#, sql

I see code examples posted online all the time that look like this: cmd.Parameters.AddWithValue(“@Parameter”, txtTextBox1.Text); This needs to stop. There is a problem with the AddWithValue() function: it has to infer the database type for your query parameter. Here’s the thing: sometimes it gets it wrong. This especially happens with database layers that deal in Object arrays […]

[Read more →]

Tags:

Coding for Branch Prediction

June 27th, 2013 · 2 Comments · .net, c#, development

Modern CPUs don’t work the way most programmers think. We’re taught this model that a processor has an instruction pointer that increments through our code, jumping to the right place when we call a function or use a loop or conditional, and a line executes when the instruction pointer reaches that line. That used to […]

[Read more →]

Tags: