Archive for the 'Tips' Category

ASP.NET Membership Schema

I was googling for the ASP.NET Membership Database Schema (the ASPNETDB.mdf in App_Data folder) for some small project but I can’t seem to find one. The following keywords were used “asp.net membership diagram”, “asp.net membership database diagram”, “asp.net membership schema” but none of them gave me relevant results.

As a result, I instead create a diagram of my own that can be printed clear on a letter (8.5×11) paper. You can download it here.

Advertisements

Sourcesafe Automation Tips

I am currently playing with the Visual Sourcesafe Automation for implementation in one of my projects. I was trying to traverse the files of a specific project (aka folder) and the code in Visual Basic.NET works like this:


Dim vssDB As IVSSDatabase = New VSSDatabase
vssDB.Open("srcsafe.ini location", "username", "password")
Dim sfolder As VSSItem
sfolder = vssDB.VSSItem("$/MyProject").Items(True).Item(1)

Dim xItem As VSSItem

For Each xItem In sfolder.Items(False)
System.Diagnostics.Debug.Print(xItem.Name & " - " & xItem.VersionNumber)
'xItem.Checkout()
'xItem.Checkin()
'xItem.Get("c:\\temp1")
Next

If I want to perform some of the operations (such as check in/out), I just have to modify the lines in the for each loop to work. Since I am a C# developer, I translated the same code and it appears like this:

IVSSDatabase vssDB = new VSSDatabase();
vssDB.Open("srcsafe.ini location", "username", "password");
VSSItem sfolder;

sfolder = vssDB.VSSItem("$/MyProject").Items(true).Item(1);

VSSItem xItem;

foreach ( xItem in sfolder.Items(false)) {
System.Diagnostics.Debug.Print(xItem.Name + " - " + xItem.VersionNumber);
//xItem.Checkout();
//xItem.Checkin();
//xItem.Get("c:\\temp1");
}

What keeps me wondering is that the code for VB works while the one for C# had errors. Specifically on line 5, it triggers an error that the VSSItem is not supported by the language. I made a workaround on the structure and the working version is this:

IVSSDatabase vssDB = new VSSDatabase();
vssDB.Open("srcsafe.ini location", "username", "password");
VSSItem sfolder;

sfolder = (VSSItem)vssDB.get_VSSItem("$/MyWebsite", false);

foreach ( VSSItem xItem in sfolder.get_Items(false)) {
string outputdisplay = xItem.Name + " - " + xItem.VersionNumber + "<br />";
Response.Write(outputdisplay);
//xItem.Checkout("comments_here", "checkout_location", 0);
//xItem.Checkin("comments_here", "checkout_location", 0);
}

Since C# doesn’t accept optional parameters, you need to fill-in for the parameters. I hope this one helps and makes sense for those who are working on Sourcesafe Automation. 🙂


Blog Stats

  • 3,978 hits
October 2017
S M T W T F S
« Nov    
1234567
891011121314
15161718192021
22232425262728
293031