Joseph Michael Pesch
VP Programming

Virtual PC - Copying image that was connected to a domain

by 29. September 2008 15:59

Virtual PC - Copying image that was connected to a domain
There are a few issues that you need to deal with if the VM is joined to the domain. You will need to copy the relevant .vhd (disk image) and .vmc (config) files from the source, and then either:

  1. Run sysprep on your copy (may break some software installs)
  2. Or, manually change machine name
    • remove your copy from the domain (must be while disconnected from the network)
    • run newsid on the vm (available from sysinternals)
    • rename the vm
    • rejoin the vm to the domain

Tags:

Virtual PC

LINQ to SQL Links

by 14. September 2008 03:52

Tags:

[None]

SQL Transfer Object Between Schemas

by 14. September 2008 02:36

alterschema NewSchemaHere transfer ExistingSchemaHere.ObjectNameHere

Example: alter schema dbo transfer jpesch.tbl_SomeTable

This would transfer the table (tbl_SomeTable) from jpesch to dbo

 

Tags:

SQL Server

C# Regular Expression Date

by 12. September 2008 20:19

Author: Pujitha Sendanayake    01 Sep 2006 
Original Article: http://www.dotnetspider.com/forum/ViewForum.aspx?ForumId=147
c# Date validator function with Leap Year handling
-------------------------------------------------------------------------------------------------------------
public bool isDate(string strDate)
{
string strRegex = @"((^(10|12|0?[13578])([/])(3[01]|[12][0-9]|0?[1-9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(11|0?[469])([/])(30|[12][0-9]|0?[1-9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(0?2)([/])(2[0-8]|1[0-9]|0?[1- 9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(0?2)([/])(29)([/])([2468][048]00)$)|(^(0?2)([/])(29)([/])([3579][26]00)$)|(^(0?2)([/])(29)([/])([1][89][0][48])$)|(^(0?2)([/])(29)([/])([2-9][0-9][0][48])$)|(^(0?2)([/])(29)([/])([1][89][2468][048])$)|(^(0?2)([/])(29)([/])([2-9][0-9][2468][048])$)|(^(0?2)([/])(29)([/])([1][89][13579][26])$)|(^(0?2)([/])(29)([/])([2-9][0-9][13579][26])$))";

Regex re = new Regex(strRegex);
if (re.IsMatch(strDate))
return (true);
else
return (false);
}

This function will validate any date from 1800 -to 9999.
Also It will handle leap years.
Allowed formats are mm/dd/yyyy , m/dd/yyyy , mm/d/yyyy , m/d/yyyy.
 

 

Tags:

[None]

C# Regular Expression Date Validation

by 12. September 2008 20:15

Author: Pujitha Sendanayake    01 Sep 2006 
Original Article: http://www.dotnetspider.com/forum/ViewForum.aspx?ForumId=147
c# Date validator function with Leap Year handling
-------------------------------------------------------------------------------------------------------------
public bool isDate(string strDate)
{
string strRegex = @"((^(10|12|0?[13578])([/])(3[01]|[12][0-9]|0?[1-9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(11|0?[469])([/])(30|[12][0-9]|0?[1-9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(0?2)([/])(2[0-8]|1[0-9]|0?[1- 9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(0?2)([/])(29)([/])([2468][048]00)$)|(^(0?2)([/])(29)([/])([3579][26]00)$)|(^(0?2)([/])(29)([/])([1][89][0][48])$)|(^(0?2)([/])(29)([/])([2-9][0-9][0][48])$)|(^(0?2)([/])(29)([/])([1][89][2468][048])$)|(^(0?2)([/])(29)([/])([2-9][0-9][2468][048])$)|(^(0?2)([/])(29)([/])([1][89][13579][26])$)|(^(0?2)([/])(29)([/])([2-9][0-9][13579][26])$))";

Regex re = new Regex(strRegex);
if (re.IsMatch(strDate))
return (true);
else
return (false);
}

This function will validate any date from 1800 -to 9999.
Also It will handle leap years.
Allowed formats are mm/dd/yyyy , m/dd/yyyy , mm/d/yyyy , m/d/yyyy.
 

 

Tags:

[None]