Blog Archives

SQL Server – Add Column Script

–Add a column to an existing table ALTER TABLE dbo.EmployeeADD Active varchar(1)GO –Add default to new column ALTER TABLE dbo.EmployeeADD CONSTRAINT Employee_Active¬†DEFAULT (‘N’) FOR ActiveGO

Tagged with: , , , ,
Posted in Visual Studio Code Examples

Visual Studio: Display A File List In A DataGridView Control

This example also shows how to extract an icon image from a file in a windows directory and display the icon in a DataGridView Control.  One advantage of displaying a list of files in the DataGridView Control, is that you

Tagged with: , , , , , , ,
Posted in Visual Studio Code Examples

Visual Studio String Functions-CSharp

string sHold = “”; int nIndex = 0; //Replaces a string with a specified string. sHold = “String Test”; sHold = sHold.Replace(“String”, “Replace”); //Returns “Replace Test” //Removes a specified number of characters from a string //The first number is the

Tagged with: , , , , ,
Posted in Visual Studio Code Examples

Display A Directory List In A TextBox Control

Display A Directory List In A TextBox Control First complete the following steps: Create a new C# Windows Application in Visual Studio. Add a button control to the form. Add a TextBox Control to the form. Change the Multiline Property

Tagged with: , , , , , ,
Posted in Visual Studio Code Examples

Create a HTML File From a DataGridView Control

First complete the following steps: Create a new C# Windows Application in Visual Studio. Add two button controls to the form. Add a DataGridView Control to the form. Double Click on the Form and add the code below to the

Tagged with: , , , , , ,
Posted in Visual Studio Code Examples

Export To A Text File From A DataGridView Control

Save Data From A DataGridView Control To A Text File Steps: Create a new C# project. Add a button control to Form1. Add a DataGridView Control to Form1. Double click on the form, and copy and the code below into

Tagged with: , , , , , ,
Posted in Visual Studio Code Examples

Dynamically Create and Execute a Batch File Using Visual Studio

Create a directory called “c:\bat”. Create a directory called “c:\zip”. Copy some .zip files to “c:\zip” Create a new Visual Studio C# application. Add a button to Form1. Double click on button1 and copy and paste the code below into

Tagged with: , , , , ,
Posted in Visual Studio Code Examples