Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
| Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 7th, 2007, 08:41 AM
Authorized User
 
Join Date: Mar 2007
Location: Pune, Maharashtra, India.
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default Connect to VSS check-in Check-out Programatically

Hello,
Can u give me any example that will programatically Check-in ,Check-out files, get Latest Version of a File, connecting to a VSS code etc.
Give me any suggestion that will help me.
Pls if there is any program written, give me the Link.

Thanks in advance
Rupesh Dhore


 
Old August 7th, 2007, 08:54 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

VSS is available thru COM. You can bring it in with a COM interop and access the various methods you desire.

NAnt is a build tool that has tasks for VSS operations. It's written in .NET and is hosted at sourceforge. You can download the complete source from there.

http://nant.sourceforge.net/

I believe the VSS tasks are in the NAntContrib "add-on" project.

http://nantcontrib.sourceforge.net/

Another open source .NET based application that interacts with VSS (among other SCM systems) is CruiseControl which is a continuous integration system.

http://confluence.public.thoughtworks.org/display/CCNET

Either of these two should provide you with very solid examples of .NET VSS calls.

-Peter
 
Old August 7th, 2007, 11:24 AM
Authorized User
 
Join Date: Mar 2007
Location: Pune, Maharashtra, India.
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you Sir firstly for ur quick contribution/reply.
I am quite happy with ur links.
But pls can u help me by giving program, example in C#.Net
I have already included a SSAPI.dll in the references from VSS's Win32 folder.

But I don't know how to connect to the VSS is it by a connection string or something else
Secondly how to take a latest version from the VSS using a button_Click or via any event

Pls help me, give me Wrox's book or any book, a site that has the program.

Thanking you in anticipation




 
Old August 8th, 2007, 08:02 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

There isn't really a connection string per se, you provide the file path to the database config file. Something like this:

\\myserver\vss\somedatabasefolder\srcsafe.ini

Have you looked at the code for those apps I linked you to? It will have examples of the code necessary for the various VSS operations you want to perform.

-Peter
 
Old August 9th, 2007, 05:33 AM
Authorized User
 
Join Date: Mar 2007
Location: Pune, Maharashtra, India.
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sir , this is my present situation, I have suceeded in Checkin, Checkout
Pls help me with How to get latest?
Sir I really respect you and expect to do the needful

This is the view of my VSS
$/
|--DevTemp
| |_____Research
|--QATemp
      |_____Research


DevTemp is for Developers
QA Temp is the latest solution, all deployment is done through this solution.
All changes made by Developer in DevTemp -> Research
are taken Latest in QATemp ->Research

Both the Research folder path are set to E:\Research on local derive

I have added the Source SafeTypeLib;
using SourceSafeTypeLib;

I created VSSDatabse object
IVSSDatabase vdb = new VSSDatabase();
IVSSItem vFile;

I have opened the VSS by open statement on Form_Load
vdb.Open(@"\\dev3\TestDeploy1\srcsafe.ini", "spatil", "spatil");

string s = "$/QATemp/Research/abc.xml"
vFile = vdb.get_VSSItem(s, false);

Check-out can be achieved by
vFile.Checkout("", "E:\\Research\\abc.xml", 0);
this checks out the file abc.xml from QATemp ->Research

********************************************
Now comes the MAJOR part
How to get the latest from the DevTemp -> Research?
********************************************

Then Check in can be done by
vFile.Checkin("", "E:\\Research\\abc.xml" + comboBox1.Text, 0);
this checks in’s the file abc.xml to QATemp ->Research

Thus changes are reflected in QATemp ->Research



 
Old August 9th, 2007, 10:30 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

In the NAntContrib source files that I referenced you will find what you need.

nantcontrib-0.85\src\Tasks\SourceSafe\GetTask.cs

Line 208: Item.Get(ref localPath, flags);

Look in the detail of the ExecuteTask method for full details.

-Peter
 
Old August 12th, 2007, 07:46 AM
Authorized User
 
Join Date: Mar 2007
Location: Pune, Maharashtra, India.
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Sir that does work.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to check programmatically check the password? thomaskelly ASP.NET 1.0 and 1.1 Basics 1 May 16th, 2008 08:49 PM
check device connect to PC by c# s_mostafa_h C# 2005 5 May 2nd, 2008 01:59 PM
HOW TO programatically connect to Access Database Deepa7476 Visual Basic 2005 Basics 4 May 23rd, 2006 09:12 AM
Help 'Check ListView' vs 'Check ListBox' MikeY C# 1 February 24th, 2005 02:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.