Below is an example of how I get a base version of my files in VSS and then apply (overwrite) any other files that are in the patch for that version.
My batch file takes 3 arguments:
1. SSDIR
2. Base label
3. Patch label
Here is an example of calling the batch file GetPatch.bat:
"C:\Documents and Settings\shane\Desktop\GetPatch.bat" \\myVSS\Sourcesafe "v0.0.1" "v0.0.1 Patch 4"
Note your label must start with a leter i.e. v0.0.1 in order for the version to be picked up.
Another thing to note is you must go into VSS and click on Tools > Options and then tick the option "Act on projects recursively".
GetPatch.bat
------------
@ECHO OFF
CLS
ECHO Arguments
ECHO =========
ECHO.
ECHO 1. SSIDR: %~1
ECHO 2. Base label: %~2
ECHO 2. Patch label: %~3
ECHO.
IF "%~1"=="" GOTO ArgumentInvalid
IF "%~2"=="" GOTO ArgumentInvalid
IF "%~3"=="" GOTO ArgumentInvalid
SET SSDIR=%~1
ECHO Getting base files for label "%~2". Please be patient this will take a few minutes.
"C:\Program Files\Microsoft Visual SourceSafe\SS.exe" GET $/VSSProject/Project1/*.* -GF -VL"%~2"
ECHO Getting patch files for label "%~3". Please be patient this will take a few minutes.
"C:\Program Files\Microsoft Visual SourceSafe\SS.exe" GET $/VSSProject/Project1/*.* -GF -VL"%~3"
ECHO.
ECHO Done
GOTO Exit
:ArgumentInvalid
ECHO Missing arguments. Not able to continue.
:Exit
ECHO.
PAUSE
Tuesday, 12 January 2010
Thursday, 3 December 2009
Example: Use a cursor to fetch records and update individual records
-- Only add the new column if it doesn't exist.
IF NOT EXISTS (
SELECT Object_ID FROM sys.columns
WHERE Name = N'DateTimeStamp' and Object_ID = Object_ID(N'dbo.tblLog')
)
BEGIN
-- Add a new column to store a proper datetime value.
ALTER TABLE dbo.tblLog
ADD DateTimeStamp DATETIME
-- Get the char dates for conversion into proper datetime objects.
DECLARE DateList CURSOR FOR
SELECT date, hour FROM dbo.tblLog FOR UPDATE OF DateTimeStamp
-- Loop variables
DECLARE @Date CHAR(20)
DECLARE @Hour INT
-- Loop thorugh and update the new column with the current row date string as a proper datetime.
OPEN DateList
FETCH NEXT FROM DateList
INTO @Date, @Hour
WHILE @@FETCH_STATUS = 0
BEGIN
UPDATE dbo.tblLog
SET DateTimeStamp = CONVERT(DATETIME, SUBSTRING(@Date, 7, 4) +
'-' + SUBSTRING(@Date, 4, 2) + '-' + SUBSTRING(@Date, 0, 3) +
' ' + CONVERT (CHAR(2), @Hour) + ':00:00')
WHERE CURRENT OF DateList
FETCH NEXT FROM DateList INTO @Date, @Hour
END
-- Clean up.
CLOSE DateList
DEALLOCATE DateList
END
SELECT * FROM dbo.tblLog
IF NOT EXISTS (
SELECT Object_ID FROM sys.columns
WHERE Name = N'DateTimeStamp' and Object_ID = Object_ID(N'dbo.tblLog')
)
BEGIN
-- Add a new column to store a proper datetime value.
ALTER TABLE dbo.tblLog
ADD DateTimeStamp DATETIME
-- Get the char dates for conversion into proper datetime objects.
DECLARE DateList CURSOR FOR
SELECT date, hour FROM dbo.tblLog FOR UPDATE OF DateTimeStamp
-- Loop variables
DECLARE @Date CHAR(20)
DECLARE @Hour INT
-- Loop thorugh and update the new column with the current row date string as a proper datetime.
OPEN DateList
FETCH NEXT FROM DateList
INTO @Date, @Hour
WHILE @@FETCH_STATUS = 0
BEGIN
UPDATE dbo.tblLog
SET DateTimeStamp = CONVERT(DATETIME, SUBSTRING(@Date, 7, 4) +
'-' + SUBSTRING(@Date, 4, 2) + '-' + SUBSTRING(@Date, 0, 3) +
' ' + CONVERT (CHAR(2), @Hour) + ':00:00')
WHERE CURRENT OF DateList
FETCH NEXT FROM DateList INTO @Date, @Hour
END
-- Clean up.
CLOSE DateList
DEALLOCATE DateList
END
SELECT * FROM dbo.tblLog
Tuesday, 17 November 2009
Generic method to get control from LoginView
private T GetLoginViewControl(string name) where T : Control
{
return LoginView1.FindControl(name) as T;
}
{
return LoginView1.FindControl(name) as T;
}
Sunday, 8 November 2009
Dual monitors not working for new install of Windows 7 on Dell M2300 laptop
I recently did a brand new install of Windows 7 Professional on my Dell Precision M2300 laptop. When I connected my monitor or TV to the laptop it was not picked up by 7.
The solution was to go onto Dell.co.uk and download the Nvidia Quadro FX 360 for Vista 32bit not Windows 7 as it is not supported.
The solution was to go onto Dell.co.uk and download the Nvidia Quadro FX 360 for Vista 32bit not Windows 7 as it is not supported.
Thursday, 5 November 2009
Browser CSS Overrides
The following is a quick reference on how to override CSS styles in different browsers.
#body
{
margin:10px; /* All browsers */
}
#body
{
margin:10px;
*margin:5px; /* IE6 Override */
}
#body, x:moz-any-link
{
margin:4px; /* Only Firefox */
}
This link is very useful: CSS Hacks
#body
{
margin:10px; /* All browsers */
}
#body
{
margin:10px;
*margin:5px; /* IE6 Override */
}
#body, x:moz-any-link
{
margin:4px; /* Only Firefox */
}
This link is very useful: CSS Hacks
Monday, 28 September 2009
SoapException: UnauthorizedAccessException
I started getting this error when I replace my existing COM object with an updated version. In order to get it to work I gave full permissions to the dll for ASPNET user.
"System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {69F9C9A0-2E91-4E87-B089-02393AB1E665} failed due to the following error: 80070005.\n at ChoicesSurveyWS.SurveyWS.GetSurveyList(String strUser, String strPass) in C:\\DevProjects\\web\\NETQuest\\WebServices\\ChoicesSurveyWS\\SurveyWS.asmx.cs:line 56\n --- End of inner exception stack trace ---"
"System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {69F9C9A0-2E91-4E87-B089-02393AB1E665} failed due to the following error: 80070005.\n at ChoicesSurveyWS.SurveyWS.GetSurveyList(String strUser, String strPass) in C:\\DevProjects\\web\\NETQuest\\WebServices\\ChoicesSurveyWS\\SurveyWS.asmx.cs:line 56\n --- End of inner exception stack trace ---"
Monday, 17 August 2009
Rounded corners no images and no JavaScript
Rounded corners style with no images and no javascript:http://blog.benogle.com/2009/04/29/css-round-corners/
Subscribe to:
Posts (Atom)