Tuesday, November 18, 2014

VB.NET - How to Print Content of Textbox

This Microsoft link will explain everything: Print Content of Textbox



Tuesday, August 12, 2014

VB.NET - Find Differences Between 2 Arrays

To get an array of common items between 2 arrays, use the .Except method off of the first array.

i.e.:

Dim strDifferences As String()
Dim strUserGroups As String()
Dim strOrgGroups As String()

strDifferences= strUserGroups.Except(strOrgGroups).ToArray()

VB.NET - Find Common Items Between 2 Arrays

To get an array of common items between 2 arrays, use the .Intersect method off of the first array.

i.e.:

Dim strSimilarities As String()
Dim strUserGroups As String()
Dim strOrgGroups As String()

strSimilarities = strUserGroups.Intersect(strOrgGroups).ToArray()

Tuesday, July 15, 2014

SQL - Update Statement from Join

UPDATE    p
SET       p.phone_ext = d.phone
FROM      people p
JOIN      directory d
ON        p.last_name = d.last_name


Friday, December 27, 2013

ASP.NET - Add Validator to Dynamically Created Control

Dim objValidator As New RegularExpressionValidator()
objValidator.ControlToValidate = txtItem.ClientID
objValidator.ValidationExpression = "[0-9]"
objValidator.Text = "*"
objValidator.ErrorMessage = "Must be in correct format"

objValidator.SetFocusOnError = True


phPlaceholder.Controls.Add(objValidator)

Friday, October 4, 2013

SQL - Declare a Table Variable

DECLARE @table_membership TABLE(   seq_id int identity(1,1),
                                            name varchar(1000) NOT NULL,
                                            contact varchar(1000) NOT NULL,
                                            type_sort int NOT NULL,

                                   )

SQL - Update Table From Itself


UPDATE a
SET a.Price=(SELECT MAX(b.PRICE) FROM ITEM AS b WHERE b.Item=a.Item and b.Price is not null )
FROM  Item AS a 


*credit goes to this post: http://stackoverflow.com/questions/12151107/tsql-update-table-from-itself