Tuesday, February 2, 2010
String Split in SQL
SET @checkedItems ='N,L,D,E'
Declare
@ParsedList table
(
OrderID varchar
)
DECLARE @OrderID varchar(10), @Pos int
SET @checkedItems = LTRIM(RTRIM(@checkedItems))+ ','
SET @Pos = CHARINDEX(',', @checkedItems, 1)
IF REPLACE(@checkedItems, ',', '') <> ''
BEGIN
WHILE @Pos > 0
BEGIN
SET @OrderID = LTRIM(RTRIM(LEFT(@checkedItems, @Pos - 1)))
IF @OrderID <> ''
BEGIN
INSERT INTO @ParsedList (OrderID)
VALUES (CAST(@OrderID AS varchar)) --Use Appropriate conversion
END
SET @checkedItems = RIGHT(@checkedItems, LEN(@checkedItems) - @Pos)
SET @Pos = CHARINDEX(',', @checkedItems, 1)
END
END
select * from @ParsedList
====================================
OUTPUT
====================================
OrderID
N
L
D
E
Sunday, January 17, 2010
How to work with TFS tools
But if we want
(1) Process Template Editor
(2) Check-In Policy Pack
(3) Work Item Templates we have to install TFS Power Tools.
But with beta 2 of TFS we cant open OOB tools like
(1) TFSConfig
(2) TFSSecurity
(3) TrxUpgrader
Then we have to
(1) Open Command Promt
(2) Cd C:\Program Files\Microsoft Team Foundation Server 2010\Tools
(3) type TFSConfig ConfigureMail /FromEmailAddress:chanaka@abc.com /SmtpHost:smtp.abc.com
(here the TFSConfig is the name of tool, rest is the command to configure email settings)
The following command can be used to identify TFS user information
tfssecurity /server:
===================================================
Also we can have WSS(Sharepoint) in our machine @any time by clicking

TFS 2010 Build automation (Solve the error)

(Set the Build Platform)
(1) Change the Platform to X64 (or X86) - Depend on your build server platform
(2) Check the Permission for TFSBuildServiceHost (Don't give network service account, give administrator account )
(3) Start/Restart TFSBuildServiceHost
(4)Set the Share location to get build files @ Server
Monday, January 11, 2010
TFS Configuration Basics
- Installing
- Upgrade Breaks Links on the SharePoint Products and Technology Portal
- Some Visual Studio Team System 2010 Features Not Available After Upgrade
- Initial Configuration of Team Foundation Server Should be Run From MSI Program or by Command Line
- Upgrade Breaks Links on the SharePoint Products and Technology Portal
- Uninstalling
- Need to uninstall TFS Object Model before uninstalling VSTS if installed from the web
- Need to uninstall TFS Object Model before uninstalling VSTS if installed from the web
- Product Issues
- Managing Users on Upgraded Team Projects Might Result in Error TF50620
- Cannot Install Team Foundation Build Service on Windows XP
- Require SSL Option Not Supported
- No Work Item Only View feature in Team System Web Access
- You Can Only Associate a Single URL with a Team Project in Team Explorer
- Team Foundation Server Service Account must be different then the account used for installing Team Foundation Server
- Uninstall Team Explorer Does Not Remove Visual Studio Shell
- Installing Team Foundation Server on a Windows Domain Requires a Live Connection to the Domain Controller
- Team Foundation Server Name May Not Be Over 14 Characters
- Do Not Launch Teamfoundation.msc Directly or Add to Microsoft Management Console (MMC)
- Changes to Lab Management Network Location Tab Requires an IIS Reset
- Managing Users on Upgraded Team Projects Might Result in Error TF50620
- Converters
- VSSConverter.exe Not Supported
- VSSConverter.exe Not Supported
- Office Integration
- Office Integration Requires Manual Installation of Office Primary Interop Assemblies (PIA) on Windows XP
- Visual Studio Team System 2010 Installation Program Appears After You Launch Microsoft Project
- Office Integration Requires Manual Installation of Office Primary Interop Assemblies (PIA) on Windows XP
- Process Templates and Team Project Portal
- No Process Guidance Updates
- Capability Maturity Model Integration (CMMI) 5.0 Process Template Incomplete
- Remote Portal Running as Network Service Can Cause Broken Dashboards
- No Process Guidance Updates
- Reporting
- Team Foundation Server Stops Collecting Reporting Data from the Team Project Collection
- Team Foundation Server Reports Are Out-of-date After Install/Upgrade
- Team Foundation Server Data Warehouse Custom Adapters Do Not Work
- Team Foundation Server Stops Collecting Reporting Data from the Team Project Collection
- Test Integration
- No Test Steps, Repro Steps or Associated Automation Controls in Team System Web Access
- No Test Steps, Repro Steps or Associated Automation Controls in Team System Web Access
- Compatibility
- Team Explorer 2008 or older client users can create new build definitions but they will not be able to edit them or to edit other, existing build definitions.
- Team Explorer 2008 or older clients will be able to submit changes that affect gated build definitions, but they will not be prompted with the confirmation dialog and, if their check-in affects multiple gated definitions, it will fail.
- Team Explorer 2008 or older clients will not be able to manage build resources using the "Manage Build Agents" dialog box.
- Microsoft Project plan documents created using a Team Explorer 2010 client, break when opened from a Team Explorer 2008 or older client.
- Navigation to non-default Shared Document, Project Portal and Process Guidance locations is broken for a Team Explorer 2008 SP1 or older clients.
- Navigation to new Reports is not supported for a Team Explorer 2008 SP1 or older clients.
- Work Item Tracking Queries with new functionality are not supported for a Team Explorer 2008 SP1 or older clients.
- Rename in Version Control is not supported for Team Explorer 2008 SP1 or older clients.
- Test Results Publishing is not supported for a Team Explorer 2008 SP1 or older clients.
- How to connect to Team Explorer 2010 to Team Foundation Server 2008
- How to connect a Team Explorer 2008 SP1 to a Team Foundation Server 2010 Server
- Team Foundation Server 2010 administrative functions are only supported using Team Explorer 2010.
- Team Explorer 2008 or older client users can create new build definitions but they will not be able to edit them or to edit other, existing build definitions.
Source: - http://blogs.msdn.com/granth
Friday, January 8, 2010
What is Cloaking in TFS
Cloaking
You can use cloaking as a performance optimization when you want to prevent a part of the source control tree from being retrieved. The following are typical scenarios for using cloaking:
• You want to build the project locally and a folder is not needed for the build, for example a documentation folder.
• You are part of a large team project and you only want to retrieve part of the project.
For either of the above scenarios you can cloak folders to stop the client retrieving those folders. You cloak folders on the client by editing the workspace and changing the status of the working folder from active to cloak.
Recommendations
• Do not cloak individual files. This is likely lead to maintenance problems later in the project.
• For a large project, map out the root folder and cloak sub folders rather than creating multiple workspaces for the project.
Source: - TFSGuide
Wednesday, January 6, 2010
What we can do using TFS
1. Source Control
2. Build automation
3. sharepoint integration
4. Process integation (Agile/CMMI)
5. Bug tracking
6. Reporting
7. Testing
TFS include management of
1. Task
2. Bug
3. Issue
4. Change Request
5. Requirement gathering
6. Review
7. Risk
8. Test case
Install TFS 2010
Prerequisites
1. IIS 6.0 or above
2. SQL Server
3. Windows Sharepoint Services
Important notes
1. Never use a domain account to install TFS
2. Remeber to run sharepoint technology wizard before all
Installation
Run the "setup.exe"
1. Install TFS
2. Extensions for sharepoint
3. Team foundation server proxy
4. Build service
Install "TeamExplorer" into a client machine that is coming with TFS package
This is where we can do all things related to Application LifeCycle Management (ALM)
Sunday, December 20, 2009
BlackBox testing Vs. WhiteBox testing
White box testing refers to testing that works with the application's internals (or code). White box (or glass box) testing is typically done by developers using the IDE, debugger, and unit tests. This is going into the deep of logic & verifies the function.
Integration testing is considered functional, or black box, testing. Testers write test cases that indicate a given input into the application. Based on this input, they make assumptions about the output of the application. The testers then execute these integration tests as a black box. That is, they do not care about what happens inside the box (the code); they simply care that they get the expected results based on the given input.
Source:- 70-547 training kit book
Friday, December 18, 2009
Testing Our Code (As a Developer I Should)
Rules
Success baseline Start by defining a unit test that represents a common, successful path through your code. This test should represent the most likely scenario for executing your code.
Parameter mix Create a unit test that provides a varied mixture of parameters for a given method. This will ensure that more than just the success path works effectively. Consider creating this scenario as a data-driven unit test.
Bounds checking Create one or more unit tests that test the upper and lower limits of your code. That is, if your method takes a numeric value, you will want to test that method with values that represent both the upper and lower range of the data type.
Null values Make sure your unit tests measure what happens when null values are passed to a given method or property.
Error conditions Create unit tests that trigger error conditions in your code. You can tell the unit test that you expect a certain error as a result. If that error is not thrown, then the test will fail.
Code coverage scenarios Make sure that all the code in your method is called by one or more unit tests. You do not want untested code sitting inside of conditional statements. If this happens, write tests that hit those conditions inside your application code.
Best Practices
- Write one test for each scenario you should test each outcome or scenario independently. If your method has a number of expected outcomes, write a test for each scenario.
- Create atomic unit tests your unit tests should not require others tests (or a sequence of tests) to be run prior to their execution or as part of their execution.
- Cover all conditions your unit tests should cover all cases. An effective set of unit tests covers every possible condition for a given method, including bounds checks, null values, exceptions, and conditional logic.
- Run without configuration your unit tests should be easy to run (and rerun). They should not require setup or configuration. You do not want to define tests that require a specific environment every time you run your tests (or they will not be run). If setup is required, code that into a test-initialize script.
- Test a common application state your unit tests should be run against a common, standard, good state. For example, if your application works with data, this data should be set to common state prior to the execution of each unit test. This ensures that one test is not causing an error in another test.
Source:- 70-547 training kit book
Sending Email Using Web.Config Entries in .NET
// Web.Config sample
<configuration>
<system.net>
<mailSettings>
<smtp from="website@website.com">
<network host="mail.website.com" password="" userName=""/>
</smtp>
</mailSettings>
</system.net>
</configuration>
// Code sample
using System.Net.Mail;
MailSettingsSectionGroup mailSettings = WebConfigurationManager.GetSection("system.net/
mailSettings") as MailSettingsSectionGroup;
protected void SendingEmail()
{
// Sending E-Mail
MailMessage message = new MailMessage(mailSettings.Smtp.From, WebConfigurationManager.AppSettings["RecipientList"], "Sending E-mail using web.config", "");
message.Priority = MailPriority.High;
SmtpClient smtp = new SmtpClient(mailSettings.Smtp.Network.Host);
smtp.Send(message);
}
My Masters
-
-
Day 1 - TechEd 2010 Sri Lanka1 day ago
-
Book on Android- Enabled Phone5 months ago

