Category: Code
This area of the site is dedicated to code snippets for quick and easy reference
Count All Rows In All Tables
There are a few ways to count all of the rows in all of your tables in a database. The “Fastest Option” actually pulls the information from the database where the numbers are stored rather than taking time to count rows.
Simple FTP Download
Reference: http://stackoverflow.com/questions/2781654/ftpwebrequest-download-file
Distinct Query On One Column
While this query has more than what may be needed this will help you to get data based on one unique column.
Check Instance Of Application
Preferred Method: Project Menu -> Properties -> Application -> Check Box: Make Single Instance Application Non-Preferred Method: This code will look in your task manager for the same name of your application, if it exists it will prevent another copy of it from running.
CSharp – Random Password Generator
Sometimes it’s helpful to simply have a random password. In this small group of code you can define what parameters to use, I have taken the liberty to remove some of the characters that are usually mistaken for a different character like an upper case I and the number 1….