Showing posts with label fire. Show all posts
Showing posts with label fire. Show all posts

Thursday, March 22, 2012

System.NullReferenceException: Object reference not set to an instance of an object.

I'm getting this error in my ASP.NET 2.0 web application when I fire following line in my code:

xmlWriter1.WriteRaw(Session["TempForm"].ToString());

Can someone tell me what am I missing ?

Does the session object TempForm exist?

I would change that code to the below and see if you still get the exception. If you do, then the issue is with xmlWriter1. If not, then it's your session variable.

string tempForm = Session["TempForm"] as string;

if (tempForm != null)
{
xmlWriter1.WriteRaw(tempForm);
}

HTH,
Ryan


Thanks Ryan, Its working now !!!

Tuesday, March 13, 2012

System.Runtime.InteropServices.COMException: Word could not fire t

You need to post the code you are using plus the full error message. I
received this type of error while trying to use query AD using
DirectoryServices and the authentication/impersonation settings in my
web.config were set to a system account that didn't have rights.
"Microsoft NEws" wrote:

> i am getting this error when creating a new document using asp.net
> your thoughts
>
>i solved it
i just added ASPNET user to Microsoft Word Document DCOM
properties/security using dcomcfg.exe
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com