Showing posts with label reference. Show all posts
Showing posts with label reference. Show all posts

Sunday, February 26, 2012

Error "Object reference not set to an instance" on SQL 2005 Reporting Services

Reporting Services on my production server stopped working. If I try to open it from Management studio, I get the error below.

Already tried installing patch 07-040, re-registering asp.net, and a few other stuff. Can you guys help me?

TITLE: Connect to Server

Cannot connect to GRUMIUM.


ADDITIONAL INFORMATION:

Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'.
The request failed with the error message:
--
<html>
<head>
<title>
SQL Server Reporting Services
</title><meta name="Generator" content="Microsoft SQL Server Reporting Services 9.00.2047.00" />
<meta name="HTTP Status" content="500" />
<meta name="ProductLocaleID" content="9" />
<meta name="CountryLocaleID" content="1033" />
<meta name="StackTrace" content />
<style>
BODY {FONT-FAMILY:Verdana; FONT-WEIGHT:normal; FONT-SIZE: 8pt; COLOR:black}
H1 {FONT-FAMILY:Verdana; FONT-WEIGHT:700; FONT-SIZE:15pt}
LI {FONT-FAMILY:Verdana; FONT-WEIGHT:normal; FONT-SIZE:8pt; DISPLAY:inline}
.ProductInfo {FONT-FAMILY:Verdana; FONT-WEIGHT:bold; FONT-SIZE: 8pt; COLOR:gray}
A:link {FONT-SIZE: 8pt; FONT-FAMILY:Verdana; COLOR[:#]3366CC; TEXT-DECORATION:none}
A:hover {FONT-SIZE: 8pt; FONT-FAMILY:Verdana; COLOR[:#]FF3300; TEXT-DECORATION:underline}
A:visited {FONT-SIZE: 8pt; FONT-FAMILY:Verdana; COLOR[:#]3366CC; TEXT-DECORATION:none}
A:visited:hover {FONT-SIZE: 8pt; FONT-FAMILY:Verdana; color[:#]FF3300; TEXT-DECORATION:underline}

</style>
</head><body bgcolor="white">
<h1>
Reporting Services Error<hr width="100%" size="1" color="silver" />
</h1><ul>
<li>An internal error occurred on the report server. See the error log for more details. (rsInternalError) <a href="http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsInternalError&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=9.00.2047.00" target="_blank">Get Online Help</a></li><ul>
<li>Object reference not set to an instance of an object.</li>
</ul>
</ul><hr width="100%" size="1" color="silver" /><span class="ProductInfo">SQL Server Reporting Services</span>
</body>
</html>
--. (Microsoft.SqlServer.Management.UI.RSClient)


BUTTONS:

OK

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1761909&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=694364&SiteID=1

This could be a variety of things, but is most likely due to some configuration that got "touched" recently.

What has been monkeyed with in IIS or with the report server configuration recently? Undo those changes!

|||

There has been no recent change to my environment. I tried a lot of things already to try re resolve the issue.

- Installed patch 07-040

http://support.microsoft.com/kb/911300/en-us

- tried re-registering asp.net

- tried removing the xmlns from the web.config file from both reportserver and reportmanager folders

All without success. Don't know what else I can do.

Friday, February 24, 2012

Error "System.NullReferenceException" on Update

Hello Everyone,

I am getting this error "System.NullReferenceException: Object reference not set to an instance of an object." when i try to run the update query as in my following code.

When the new record condition is true then the code runs absolutely fine and inserts a new record to the database. However, when it goes in the edit mode to update the record it gives an error at '## ERROR POINT FOR THE UPDATE QUERY'. Why is this happening. i have attached the portion of my code below for refernce. Can someone please help me with this? Where am i going wrong. Seems like update query has a problem.

'-------------------------------
If mode = "edit" Then

insertSql = "update [Customer Info] set [Company Name]=@.CompanyName, [Business Type]=@.BusinessSector, [Address Line 1]=@.AddressLine1, [Address Line 2]=@.AddressLine2, [Address Line 3] = @.AddressLine3, [Town] = @.Town, [County]= @.County, [Post Code]=@.PostCode, [Country]=@.Country, [Telephone]=@.Telephone, [Fax]=@.Fax, [Email Address]=@.Email, [Contact Person]=@.ContactPerson, [Job Title]=@.JobTitle, [Website Address]=@.WebsiteAddress Where [Customer ID] = " & Request.QueryString("custid")

else

insertSql = "insert into [Customer Info] ([Customer ID], [Company Name], [Business Type], [Address Line 1], [Address Line 2], [Address Line 3], [Town], [County], [Post Code], [Country], [Telephone], [Fax], [Email Address], [Contact Person], [Job Title],[Website Address])"
insertSql = insertSql & " values (@.CustomerIDSq, @.CompanyName, @.BusinessSector, @.AddressLine1, @.AddressLine2, @.AddressLine3, @.Town, @.County, @.PostCode, @.Country, @.Telephone, @.Fax, @.Email, @.ContactPerson, @.JobTitle, @.WebsiteAddress)"

end if

objConn.open()
objCommand.CommandText = insertSql '## ERROR POINT FOR THE UPDATE QUERY
objCommand.Connection = objConn

objCommand.Parameters.Add("@.CustomerIDSq", SqlDbType.Int).Value = CustomerID
objCommand.Parameters.Add("@.CompanyName", SqlDbType.VarChar).Value = Trim(txtCompanyName.Text)
objCommand.Parameters.Add("@.BusinessSector", SqlDbType.Int).Value = BusinessSector
objCommand.Parameters.Add("@.AddressLine1", SqlDbType.VarChar).Value = Trim(txtAddressLine1.Text)
objCommand.Parameters.Add("@.AddressLine2", SqlDbType.VarChar).Value = Trim(txtAddressLine2.Text)
objCommand.Parameters.Add("@.AddressLine3", SqlDbType.VarChar).Value = Trim(txtAddressLine3.Text)
objCommand.Parameters.Add("@.Town", SqlDbType.VarChar).Value = Trim(txtTown.Text)
objCommand.Parameters.Add("@.County", SqlDbType.VarChar).Value = Trim(txtCounty.Text)
objCommand.Parameters.Add("@.PostCode", SqlDbType.VarChar).Value = Trim(txtPostCode.Text)
objCommand.Parameters.Add("@.Country", SqlDbType.VarChar).Value = Trim(txtCountry.Text)
objCommand.Parameters.Add("@.Telephone", SqlDbType.VarChar).Value = Trim(txtTelephone.Text)
objCommand.Parameters.Add("@.Fax", SqlDbType.VarChar).Value = Trim(txtFax.Text)
objCommand.Parameters.Add("@.Email", SqlDbType.VarChar).Value = Trim(txtEmail.Text)
objCommand.Parameters.Add("@.ContactPerson", SqlDbType.VarChar).Value = Trim(txtContactPerson.Text)
objCommand.Parameters.Add("@.JobTitle", SqlDbType.VarChar).Value = Trim(txtJobTitle.Text)
objCommand.Parameters.Add("@.WebsiteAddress", SqlDbType.VarChar).Value = Trim(txtWebsiteAddress.Text)

objCommand.executeNonQuery()
objConn.close()

'-------------------------------

Thanks,
SimShow us where you instantiate (new) the objCommand. That is likely the problem.|||Yea, that was the problem. i was not instantiating the command object. Now i did it and it is running very fine.

Thanks You very much, how these small things gets me.. i dunno.. :o.
Sim

Friday, February 17, 2012

Error

I am getting this error trying accessing RM page.
Server Error in '/Reports' Application.
----
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set
to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
Microsoft.ReportingServices.UI.GlobalApp.Application_AuthenticateRequest(Object
sender, EventArgs e) +58
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+92
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously) +64
Any idea?
ThanksOn Aug 12, 8:20 pm, "markgoldin" <markgoldin_2...@.yahoo.com> wrote:
> I am getting this error trying accessing RM page.
> Server Error in '/Reports' Application.
> ----
> Object reference not set to an instance of an object.
> Description: An unhandled exception occurred during the execution of the
> current web request. Please review the stack trace for more information
> about the error and where it originated in the code.
> Exception Details: System.NullReferenceException: Object reference not set
> to an instance of an object.
> Source Error:
> An unhandled exception was generated during the execution of the current web
> request. Information regarding the origin and location of the exception can
> be identified using the exception stack trace below.
> Stack Trace:
> [NullReferenceException: Object reference not set to an instance of an
> object.]
> Microsoft.ReportingServices.UI.GlobalApp.Application_AuthenticateRequest(Object
> sender, EventArgs e) +58
> System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
> +92
> System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
> completedSynchronously) +64
> Any idea?
> Thanks
This looks like a dual post. Here was my response for that one.
You should try looking in the SSRS logs to see if it gives you any
descriptive information (normally located in: C:\Program Files
\Microsoft SQL Server\MSSQL.2\Reporting Services\LogFiles ). If you
cannot resolve the issue by looking at the logs, you should look into
reinstalling SSRS. Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant