02 April 2014

COM object that has been separated from its underlying RCW cannot be used

COM object that has been separated from its underlying RCW cannot be used. Error occured when i closed the application in C#.net
How to fix it?


 I am using event watcher in my Application . So I didn't stop when i close the Application ,So I Stop eventWatcher. solved issue

21 March 2014

Update auto_increment in SQL Server

Update auto_increment in SQL Server

Create PROC SP_UpdateEmployee @Id int = null out, @employeename varchar(50), @Active bit AS INSERT INTO Employeemaster(employeename,Active)values(@employeename,@Active) Set @Id = Scope_Identity()

Get Count of Unread mail from Outlook Express in C#.Net

Get Count of Unread mail from Outlook Express in C#.Net

 using Microsoft.Office.Interop.Outlook;  
public static int CountOfUnreadMails()
{
Application OutlookApp = new Application();
NameSpace myMail = OutlookApp.GetNamespace("MAPI");
int unread = myMail.GetDefaultFolder(OlDefaultFolders.olFolderInbox).UnReadItemCount;
return unread;
}