Monthly Archives: January 2011

SQL – Reverse Function

REVERSE FUNCTION If for some reason, you need to reverse the direction of characters or numbers in a field, you can use the reverse function. SQL Server SELECT REVERSE(‘WORD’) Returns ‘DROW’ Oracle SELECT REVERSE(‘WORD’) FROM DUAL; Returns ‘DROW’  

Tagged with: , , , ,
Posted in Oracle, SQL Server

SQL – Substring Function

SUBSTRING FUNCTION Return a portion of a selected string. SQL Server Syntax – SUBSTRING(string, starting position, ending position) SELECT SUBSTRING(‘WORD’,1,2) Returns ‘WO’ Oracle Syntax – SUBSTRING(string, starting position, ending position) SELECT SUBSTR(‘WORD’,1,2) Returns ‘WO’  

Tagged with: , , , ,
Posted in Oracle, SQL Server

SQL – Character Index

CHARACTER INDEX SQL Server SELECT CHARINDEX(‘WORD’, ‘FIND WORD IN THIS SENTENCE.’) Returns 6 (WORD starts in the 6th position of the sentence.) Oracle SELECT INSTR(‘FIND WORD IN THIS SENTENCE’, ‘WORD’) FROM DUAL; Returns 6 (WORD starts in the 6th position

Tagged with: , , ,
Posted in Oracle, SQL Server

SQL NULLIF Function

NULLIF FUNCTION: Compares two values and does the following: Returns null if both values are the same. Returns the first value if both values are different. SQL Server: Select NULLIF(FIELD1, FIELD2) AS FIELD3 FROM TABLE; Oracle: Select NULLIF(FIELD1, FIELD2) AS

Tagged with: , , , , ,
Posted in Oracle, SQL Server

Dynamically Populate a DataGridView Using Enterprise Library With Values From a Selected Table in SQL Server

Dynamically Populate a DataGridView Using Enterprise Library With Values From a Selected Table in SQL Server This is a quick way to give a user the ability raw look at the data contained in tables in the database linked to

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

C Sharp File Functions

C# File Functions The example below shows different ways to use the Copy and Move functions associated with the System.IO class library in Visual Studio. It is written using C#. In order to test, copy and paste the code below

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

Reading from a Text File In Visual Studio C#

Create a new Windows Application Add a New form Add a textbox to the form; use the default name for the textbox. Make sure to change the Multiline Property of the textbox to True. After changing the Multiline Property of

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