Help! Dataset returning an error on one machine, works fine on another.

R

Rico

Hello,

I have a web application that I developed in ASP.NET on one machine and I'm
trying to deploy it on a Windows 2003 Server. The application runs fine on
the development workstation connected to the development SQL Server 2000.

I've deployed the application to the server and it works fine, accesses the
data in the SQL database, but the problem comes when I try to create a
report using a dataset. I get an error "Object reference not set to an
instance of an object". This occurs on every report I try. Any idea what I
should look at?

I also have a second problem; the server does not (and will not) have
VS2003 installed, I have administrator privledges, I have taken all the
advice I can from elsewhere on the net (re: IIS set up, HTTP Keep Alive,
Windows Authentication etc) but I can't debug the ASP.net application from
this workstation, I get the error "Unable to start debugging on the web
server. The debugger is not properly installed. Run setup to install or
repair the debugger." But the problem is, Visual Studio is not going to be
installed on the server and I know debugging can take place without VS
installed, but can't find a solution to this problem.

Any help would be greatly appreciated.

Thanks!
 
P

Patrick.O.Ige

Rico maybe try posting some code how you are trying to
write the report
Patrick
"Rico" <r c o l l e n s @ h e m m i n g w a y . c o mREMOVE THIS PART IN
CAPS> wrote in message news:Sw8Ef.409503$2k.312999@pd7tw1no...
 
R

Rico

I've pasted the code below. I don't think it's the code that's the issue,
since it works fine on this machine, but blows up on the server. Here is is
either way;

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim dt As New dbTier
Dim ds As DataSet, dv As DataView
Dim dsA As New dsCourses
Dim i As Long
Dim r As DataRow
Dim t As Long

t = Date.Now.Ticks()


ds = dt.GenericDS("SELECT * FROM [viewCourses];")

'!!!!!! NOTE: The following line is where the code blows up on the server.
dv = ds.Tables(0).DefaultView
'!!!!!!
For i = 0 To dv.Count - 1
' Check to see if this record is valid.
r = dsA.Tables("viewCourses").NewRow()
r("CourseID") = dv(i)("CourseID")
r("Title") = dv(i)("Title")
r("Description") = dv(i)("Description")
r("Safety") = dv(i)("Safety")
r("RetrainInterval") = dv(i)("RetrainInterval")
dsA.Tables("viewCourses").Rows.Add(r)

Next
ds.Dispose()


r = dsA.Tables("Heading").NewRow
r("Heading1") = "Western Forest Products Inc."
r("Heading2") = ""
dsA.Tables("Heading").Rows.Add(r)

' Load the report document and push in the data.
Dim fname As String
Dim rpt As New ReportDocument
Dim repName As String

'rpt.Load(Server.MapPath("rptTrainingRequired_I.rpt"))
repName = Request.Form("repName")
rpt.Load(Server.MapPath(repName))


Dim exp As ExportOptions = rpt.ExportOptions

exp.ExportFormatType = ExportFormatType.PortableDocFormat
exp.ExportDestinationType = ExportDestinationType.DiskFile

exp.DestinationOptions = New DiskFileDestinationOptions
fname = GetNewFilename() & ".pdf"
exp.DestinationOptions.diskfilename = Server.MapPath("reports/pdf/"
& fname)

rpt.SetDataSource(dsA)
rpt.Export()

Link = "reports/pdf/" & fname

t = Date.Now.Ticks - t
ElapsedTicks = t
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top