Category Archives: Troubleshooting

TFS: Delete workspace of another user from command line

One of my team member left the company and some of the project files were checked out by him. Other team members were not able to checkout those files to work on. TFS Administrator console also does not provide any … Continue reading

Posted in Troubleshooting | Leave a comment

TRUNCATE / SHRINK Log File – SQL Server 2008

PLEASE READ THIS BEFORE TAKING ANY ACTION. One of my database’s log file grew to 251 GB. I was not able to take its backup or detach database for the purpose of moving this database to another server. It was … Continue reading

Posted in Knowledge Sharing, SQL Server, Troubleshooting | Leave a comment

SQL Server 2005 – Shrink log file of all databases

One of database server was running out of disk space. The culprit was the very large SQL server log files. Using following script i was able to shrink log files of all databses in a SQL server instance so creating … Continue reading

Posted in Knowledge Sharing, SQL Server, Troubleshooting | Leave a comment

ASP.NET+MVC+Entity Framework Error – CS0012: The type ‘System.Data.Objects.DataClasses.EntityObject’ is defined in an assembly that is not referenced. You must add a reference to assembly System.Data.Entity

I created a blank MVC4 site in which I tried consuming a WCF. Data was returned from WCF and available in MVC controller but when I was trying to use the data in MVC View using model; I was left … Continue reading

Posted in Entity Framework, Knowledge Sharing, MVC, Troubleshooting | Leave a comment

MVC4 error- Unable to complete operation. The supplied SqlConnection does not specify an initial catalog

I was trying to do my hands dirty today with MVC4. I was following MvcMovieStore example. Following everything correctly till “Accessing Your Model’s Data from a Controller”, i was stuck with this error. Struggling to this i found that by … Continue reading

Posted in ASP.NET, Entity Framework, Knowledge Sharing, MVC, Troubleshooting | Comments Off

Creating tamper proof Url in asp.net – a way to prevent spoofing and forged HTTP requests

Consider the following URL- http://www.mysite.com/orders.aspx?id=10 Now the problem is that anybody having this link can view more data than authorised and required by simply changing the value of id to say 16,17,18,19… Another problem could be that script tags could … Continue reading

Posted in ASP.NET, C#, Knowledge Sharing, Troubleshooting | Leave a comment

How to load a server side image in Silverlight Image control – another way to reduce XAP size

Direct references to images should be avoided in a Silverlight project as it makes the XAP file heavier. An alternative could be to have the images on server and load images by creating bitmap of the image by using the … Continue reading

Posted in ASP.NET, C#, Knowledge Sharing, Silverlight, Troubleshooting | Leave a comment

Using Images in Silverlight project = large XAP size

Using images in Silverlight project can cause serious problem of very large XAP size thus increased page load time. All images references in any Silverlight project are compiled and included into dll in XAP file. If you look inside XAP … Continue reading

Posted in Knowledge Sharing, Silverlight, Troubleshooting | Leave a comment

Why Interfaces in C#

Consider the following code snippets- // Code for the IAccount interface module. public interface IAccount { void PostInterest(); void DeductFees(IFeeSchedule feeSchedule); } class BusinessAccount : IAccount { void IAccount.PostInterest() { // Code to post interest using the most favorable rate. … Continue reading

Posted in C#, Knowledge Sharing, Troubleshooting | 4 Comments

Silverlight – Application Library Caching

Caching assemblies at client can dramatically improve performance of a Silverlight application. When Application Library Caching is enabled for a Silverlight application, overall application startup improves as all third party assemblies/ DLLs are already on the client. In this case, … Continue reading

Posted in Knowledge Sharing, Silverlight, Troubleshooting | 4 Comments