//1st
//Before:
TreeNode node = new TreeNode(drive.Substring(0, 1), driveImage, driveImage);
node.Tag = drive;
//After:
var node = new TreeNode(drive.Substring(0, 1), driveImage, driveImage) {
Tag = drive
};
//2nd
//Before:
DirectoryInfo di = new DirectoryInfo(dir);
TreeNode node = new TreeNode(di.Name, 0, 1); //this line
//After:
var node = new TreeNode((new DirectoryInfo(dir)).Name, 0, 1);
//3rd
//Before:
OleDbCommand select = new OleDbCommand();//this line
select.Connection = cnDTC;
select.CommandText = string.Format("SELECT MAX(VERSION_NO) AS MAX_VERSION FROM ({0})",
strSQL2);
//After:
var select = new OleDbCommand(
String.Format("SELECT MAX(VERSION_NO) AS MAX_VERSION FROM ({0})", strSQL2),
cnDTC);
//3rd (with string interpolation):
var select = new OleDbCommand($"SELECT MAX(VERSION_NO) AS MAX_VERSION FROM ({strSQL2})",
cnDTC);