Visual Studio – Database Project Not Loading

Have you ever created a Database project and after some time you are not able to load it in the Visual Studio? Probably you might be getting following error: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified) The database project requires an active database connection to load at design time. Probably it uses that to compile/verify scripts. The problem here…

Read more

Checklist: Cannot import webpart

While importing (drag/drop) your webpart to any SharePoint page, if you receive an error stating “Cannot import webpart” or “unable to add selected web part(s)”! here is the check list you should look for: Make sure the webpart class is inherited either from Microsoft.SharePoint.WebPartPages.WebPart or System.Web.UI.WebControls.WebParts.WebPart The webpart class needs to be declared public. Safe controls entry in web.config file. If you are referring a webpart from GAC (i.e. assembly containing webpart class is placed in GAC) make sure the GAC version is the latest build and IIS is re-started. – Ankit

Read more


Windows CardSpace: FAQ for ASP.NET Developers

Few frequently asked question for ASP.NET developers: The Identity Selector dialog box is displayed only for SSL protected pages. Therefore you are required to deploy your application on a Web server and install a SSL Certificate. Windows CardSpace does not work with Self Signed Certificates and will die horribly. These certificates do not have CRL field. It contains a URL that CardSpace will check for the revocation list. For ASP.NET developers there is Toolbox control written by Christian Arnold. Add this to your Toolbox and you won’t need to write a single line of code. Watch demo. When you use…

Read more

TFS – Free Text search in History Objects

It’s a best practice to add comment when you do check-in to the source control. A text comment is associated with the change you made to the item. Some of the times you need to find a particular comment, but the View History tool available with Visual Studio/TFS is limited that you can’t make a search in the history results. Say you want to find all check-ins by a particular user 🙁 Here comes the purpose of this small add-in. It provides search within history comments and find a particular change-set instead of traversing the whole list. The plug-in goes…

Read more

Preview: LINQ

Hmmm… a new tool in my hands … and following equation makes me crazy about it! C# 2.0 + ADO.NET = LINQ = C# 3.0 In simple words Language Integrated Query (LINQ) exposes the power of SQL queries within C# syntax. This technology along with its tools allows you to connect to SQL database, extract metadata, build typed datasets/classes (using C# Generics) and make you use them along with C# syntax using just two lines of code. And not necessarily SQL databases, it can execute on any collection type. int[] numbers = { 5, 4, 1, 3, 9, 8, 6,…

Read more

Webservices PowerPoint Presentation

My presentation on WebServices Basics is available for download to the *valuable visitors* of my blog. Here is the content: Web services – Definition: A web service is a collection of protocols and standards used for exchanging data between applications or systems. Characteristics Demo: Writing a simple WebService in Visual Studio 2005 & Consuming WebServices Technologies: XML (eXtensible Markup Language), SOAP (Simple Object Access Protocol), WSDL (Web services description language), UDDI (universal description, discovery, and integration) SOAP: SOAP is an open protocol specification defining a uniform way of performing RPCs using HTTP as the underlying communications protocol with XML for…

Read more

Fetching file history from TFS : the code way

These days I’m writing a tool for Visual Studio that integrates with Team Foundation Server. This post is about how to retrieve/fetch history of a file from source control server using TFS-SDK. Following function takes server name and file path as input and returns an enumerator holding Changeset objects. public static IEnumerable FetchHistory(string serverName, string filePath) { TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer(serverName); VersionControlServer vcs = tfs.GetService(typeof(VersionControlServer)) as VersionControlServer; ExtendedItem[] itemArray1 = vcs.GetExtendedItems(filePath, DeletedState.NonDeleted, ItemType.Any); if ((itemArray1 == null) || (itemArray1.Length == 0)) throw new Exception(“There are no items.”); ExtendedItem item1 = itemArray1[0]; IEnumerable enumerable1 = vcs.QueryHistory(filePath, VersionSpec.Latest, item1.DeletionId, (item1.ItemType == ItemType.Folder)…

Read more

3D Full Screen Window and Dynamic XAML Sample with WPF

One nice feature of WPF (Windows Presentation Foundation, .Net 3.0) is the integration of 3D library with the existing framework. Today I worked with Viewport3D class. This class handles it all for managing 3D views. The “Hello World” example I coded here basically demonstrates three features: Loading XAML dynamically at runtime Playing with 3D objects using Viewport3D and make them rotate using mouse. Creating transparent and full-screen windows Let’s drill down to the technical details of above three aspects: Firstly, loading XAML runtime can be achieved using System.Windows.Markup.XamlReader class. The Load function takes a stream object (containing XAML source) and…

Read more

IE extensions/add-on – the simplest way (context menu)

I love writing extensions for applications and filling gaps in between making the world simpler (interacting with each other, giving users flexibility in switching from one application to another.) The power of any application (especially Internet Browsers) lies in how features enriched it is. One of the way to achieve this is to lay down extensible architecture and promote developers to write extensions for you application. Moreover such architecture should provide the simplest method to write an extension in few seconds (“hello world” example) more flexible in term of autonomy to developer for by exposing a rich set of API,…

Read more