.NET

Installing assembly in GAC in Windows Server 2008 : Resolved

I developed an event handler and need to deploy it on production server. My production server is built on Windows 2008 Enterprise Server 64 Bit and there was only one installation on server i.e. SharePoint Server 2010. Now I need to install my assembly in to GAC. I copied my .dll to production server. Then Installing assembly in GAC in Windows Server 2008 : Resolved

Call Hierarchy : A handy feature in Visual Studio 2010

Suppose we have a solution that contains different dependent projects. We can face 2 most common situation here: Situation 1: We have a method that we need to change by modifying the definition of that method or just we want to check that which other methods are calling this method. Situation 2: We have a Call Hierarchy : A handy feature in Visual Studio 2010

Resolved: Could not load file or assembly ‘Microsoft.SharePoint.Search, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’ or one of its dependencies…

I have a solution that contains SharePoint dll’s reference. Whenever I run the solution, start page get crash and show me this error. “Could not load file or assembly ‘Microsoft.SharePoint.Search, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’ or one of its dependencies. An attempt was made to load a program with an incorrect format.” Well every time I run Resolved: Could not load file or assembly ‘Microsoft.SharePoint.Search, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’ or one of its dependencies…

Common errors with SharePoint 2010 development using Visual Studio 2010 in x64 architecture: Resolved

“The type or namespace name ‘SharePoint’ does not exist in the namespace ‘Microsoft’ (are you missing an assembly reference?” (Even you add Microsot.SharePoint.dll reference in your project and import the namespace in code but while building the solution you will get above mentioned annoying error.) OR “FileNotFoundException was unhandled: The Web application at http://localhost/ could Common errors with SharePoint 2010 development using Visual Studio 2010 in x64 architecture: Resolved

Resolved: COM DLL is not showing in COM Library after Registering on Windows Server 2008 x64

Well I had to implement a payment gateway at my server. My server was built on x64 architecture and had Windows Server 2008 installed. Well according to the document I had to put my COM dll inside c:\windows\system32 folder and then from Run command I had to register this dll like “regsvr32 c:\windows\system32\MyCOM.dll”. Well I Resolved: COM DLL is not showing in COM Library after Registering on Windows Server 2008 x64

Get HTML of a web page using C#.NET

Below i am using a function that takes a web page full url as string and return back HTML of that page as string. You can use this returned HTML in your code as per your requirement. Step 1: First import 2 namespaces that are required by this function to work. using System.IO; using System.Net; Get HTML of a web page using C#.NET

Nullable Types in Depth

This Article explains the Nullable Types in .NET 2.0 Nullable Types are instances of the System.Nullable struct introduced in .NET 2.0. Null means value undefined or value not known. Reference types by design support storing null but values types have been designed to store only the range of values they are made for. They don’t Nullable Types in Depth

Object cannot be cast from DBNull to other types

Sometimes you need to code around dates in your program. Today i will discuss about the common error we get while displaying a date from back end to front end. What if you have blank/null value inserted in your back end for date and when you get this date to front end and try to Object cannot be cast from DBNull to other types

Convert date from dd/MM/yyyy to MM/dd/yyyy for storing in SharePoint list or Sql Server Database

I was working on a custom web part that takes the date in Indian format e.g. dd/MM/yyyy while inserting the record in SharePoint custom list. But as we know that SharePoint custom list insert the date value as MM/dd/yyyy format. So it was throwing me the error for invalid string format so below is the Convert date from dd/MM/yyyy to MM/dd/yyyy for storing in SharePoint list or Sql Server Database

Resolved: Collection was modified; enumeration operation may not execute

I was playing with a data table object, my requirement was to merge all duplicate rows to one and remove the duplicates. e.g. Book     Price Quantity Title 1 210   4 Title 1 210   6 Title 1 210   8 These were the rows inside my data table object. I want a consolidated row in place Resolved: Collection was modified; enumeration operation may not execute