Wednesday, March 28, 2012
System.InvalidOperationException: Application is restarting
I am getting the following exception in an ASP.NET
application.
Exception Details: System.InvalidOperationException:
Application is restarting.
I have been to the following Support page
http://support.microsoft.com/default.aspx?kbid=312592
and disabled the Realtime monitoring. But, I was not able
to solve the issue.
Any suggestions are greatly appreciated.
Thanks a lot in advance,
Regards
HariHi,
There are vast spectrums of situations that can cause application
restarting. I suggest that you find first the line that causes
application to restart. Start with simple application to check out if
this problem is application specific. If this is the case and other
application doesnt cause recycling you should find the application line
that cause recycling.
Natty Gur[MVP]
blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Thanks Natty for your prompt reply. Unfortunately I don't
have the real access to the code at the moment and I am
kind of new to ASP.NET. But, I understand the technology
well.
The following is the exception I was getting when this
error occurs: Please have a look if it makes sense. Any
advice from your side is greatly respected.
************************************************** *******
Source=System.Web
Message=Application is
restarting.
StackTrace= at
System.Web.Compilation.CompilationMutex.WaitOne()
+282
at System.Web.Compilation.CompilationLock.GetLock()
+13
at System.Web.UI.TemplateParser.GetParserCacheItem()
+64
at
System.Web.UI.TemplateControlParser.CompileAndGetP arserCac
heItem(String
virtualPath, String inputFile, HttpContext context)
+115
at
System.Web.UI.TemplateControlParser.GetCompiledIns tance
(String
virtualPath, String inputFile, HttpContext context)
+36
at System.Web.UI.PageParser.GetCompiledPageInstance
(String
virtualPath, String inputFile, HttpContext context) +43
at System.Web.UI.PageHandlerFactory.GetHandler
(HttpContext context,
String requestType, String url, String path) +14
at System.Web.HttpApplication.MapHttpHandler
(HttpContext context,
String requestType, String path, String pathTranslated,
Boolean
useAppConfig)
at System.Web.MapHandlerExecutionStep.Execute()
+78
at System.Web.HttpApplication.ExecuteStep
(IExecutionStep step,
Boolean& completedSynchronously) +173
AllException=System.InvalidOperationException:
Application is
restarting.
at System.Web.Compilation.CompilationMutex.WaitOne
()
at System.Web.Compilation.CompilationLock.GetLock
()
at System.Web.UI.TemplateParser.GetParserCacheItem
()
at
System.Web.UI.TemplateControlParser.CompileAndGetP arserCac
heItem(String
virtualPath, String inputFile, HttpContext
context)
at
System.Web.UI.TemplateControlParser.GetCompiledIns tance
(String
virtualPath, String inputFile, HttpContext
context)
at System.Web.UI.PageParser.GetCompiledPageInstance
(String
virtualPath, String inputFile, HttpContext
context)
at System.Web.UI.PageHandlerFactory.GetHandler
(HttpContext context,
String requestType, String url, String
path)
at System.Web.HttpApplication.MapHttpHandler
(HttpContext context,
String requestType, String path, String pathTranslated,
Boolean
useAppConfig)
at System.Web.MapHandlerExecutionStep.Execute
()
at System.Web.HttpApplication.ExecuteStep
(IExecutionStep step,
Boolean&
completedSynchronously)
************************************************** *******
Any advice on this is greatly appreciated
Thanks you very much
Best Regards
Hari
>--Original Message--
>Hi,
>There are vast spectrums of situations that can cause
application
>restarting. I suggest that you find first the line that
causes
>application to restart. Start with simple application to
check out if
>this problem is application specific. If this is the
case and other
>application doesn't cause recycling you should find the
application line
>that cause recycling.
>Natty Gur[MVP]
>blog : http://weblogs.asp.net/ngur
>Mobile: +972-(0)58-888377
>
>*** Sent via Developersdex http://www.developersdex.com
***
>Don't just participate in USENET...get rewarded for it!
>.
Hi,
Nothing special with excaption stuck. it's regular operations that
called while loading a page. try to delete the temporary directory of
your application under
""C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\Tempo rary ASP.NET
Files\YourApplicationName".
Natty Gur[MVP]
blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Hi,
Nothing special with excaption stuck. it's regular operations that
called while loading a page. try to delete the temporary directory of
your application under
""C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\Tempo rary ASP.NET
Files\YourApplicationName".
Natty Gur[MVP]
blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
System.IO.Directory.GetDirectories() and System.IO.Directory.GetFiles() are not returning
specified directory on the server. I use the
System.IO.Directory.GetDirectories() and System.IO.Directory.GetFiles() to
retrieve the lists of files and directories. I have two very similar
versions of this that I am debugging, both of which use the methods
mentioned above. However, one of them is returning the contents of the
specified directory and the other is returning the contents of the project's
directory. I have checked to see what values are used by and returned by
System.IO.Directory.GetDirectories() and System.IO.Directory.GetFiles(), and
they use the values I expect, but do not return the directories and files in
that directory. What is going on here?"Nathan Sokalski" <njsokalski@.hotmail.comwrote in message
news:ehSNlnJ8HHA.5164@.TK2MSFTNGP05.phx.gbl...
Quote:
Originally Posted by
>I have an ASP.NET application which displays the directories & files in a
>specified directory on the server. I use the
>System.IO.Directory.GetDirectories() and System.IO.Directory.GetFiles() to
>retrieve the lists of files and directories. I have two very similar
>versions of this that I am debugging, both of which use the methods
>mentioned above. However, one of them is returning the contents of the
>specified directory and the other is returning the contents of the
>project's directory. I have checked to see what values are used by and
>returned by System.IO.Directory.GetDirectories() and
>System.IO.Directory.GetFiles(), and they use the values I expect, but do
>not return the directories and files in that directory. What is going on
>here?
[X-posting removed]
Please show your code...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
On Sep 6, 11:23 am, "Nathan Sokalski" <njsokal...@.hotmail.comwrote:
Quote:
Originally Posted by
I have an ASP.NET application which displays the directories & files in a
specified directory on the server. I use the
System.IO.Directory.GetDirectories() and System.IO.Directory.GetFiles() to
retrieve the lists of files and directories. I have two very similar
versions of this that I am debugging, both of which use the methods
mentioned above. However, one of them is returning the contents of the
specified directory and the other is returning the contents of the project's
directory. I have checked to see what values are used by and returned by
System.IO.Directory.GetDirectories() and System.IO.Directory.GetFiles(), and
they use the values I expect, but do not return the directories and files in
that directory. What is going on here?
Both of those methods work fine for me. You will need to post some
actual code that is having the problem.
System.IO.FileNotFoundException, When Accessing file in remote ser
it is giving System.IO.FileNotFoundException error. I tried mapping that
server location like "H:\ErrorLogs\error.log" still it gives error. I tried
even giving the server name and directory like
"\\server_name\\Directory\\file.log" still it gives file not found exception.
Does anyone help me fix this.
Thanksuse \\machineIP\sharename\filename
"Raja" <Raja@.discussions.microsoft.com> wrote in message
news:DC182C99-4D78-4A68-BEDC-632DDE49A827@.microsoft.com...
> I am trying to access files in a remote server from my ASP.NET
application,
> it is giving System.IO.FileNotFoundException error. I tried mapping that
> server location like "H:\ErrorLogs\error.log" still it gives error. I
tried
> even giving the server name and directory like
> "\\server_name\\Directory\\file.log" still it gives file not found
exception.
> Does anyone help me fix this.
> Thanks
asp.net normally does not have permission to any network resources. to
access a networked drive, you will have to make the asp_net account a domain
account, or specify the userName and password of a domain account in the web
config <impersonate> tag.
-- bruce (sqlwork.com)
"Raja" <Raja@.discussions.microsoft.com> wrote in message
news:DC182C99-4D78-4A68-BEDC-632DDE49A827@.microsoft.com...
> I am trying to access files in a remote server from my ASP.NET
application,
> it is giving System.IO.FileNotFoundException error. I tried mapping that
> server location like "H:\ErrorLogs\error.log" still it gives error. I
tried
> even giving the server name and directory like
> "\\server_name\\Directory\\file.log" still it gives file not found
exception.
> Does anyone help me fix this.
> Thanks
System.IO.FileNotFoundException, When Accessing file in remote ser
it is giving System.IO.FileNotFoundException error. I tried mapping that
server location like "H:\ErrorLogs\error.log" still it gives error. I tried
even giving the server name and directory like
"\\server_name\\Directory\\file.log" still it gives file not found exception
.
Does anyone help me fix this.
Thanksuse \\machineIP\sharename\filename
"Raja" <Raja@.discussions.microsoft.com> wrote in message
news:DC182C99-4D78-4A68-BEDC-632DDE49A827@.microsoft.com...
> I am trying to access files in a remote server from my ASP.NET
application,
> it is giving System.IO.FileNotFoundException error. I tried mapping that
> server location like "H:\ErrorLogs\error.log" still it gives error. I
tried
> even giving the server name and directory like
> "\\server_name\\Directory\\file.log" still it gives file not found
exception.
> Does anyone help me fix this.
> Thanks
asp.net normally does not have permission to any network resources. to
access a networked drive, you will have to make the asp_net account a domain
account, or specify the userName and password of a domain account in the web
config <impersonate> tag.
-- bruce (sqlwork.com)
"Raja" <Raja@.discussions.microsoft.com> wrote in message
news:DC182C99-4D78-4A68-BEDC-632DDE49A827@.microsoft.com...
> I am trying to access files in a remote server from my ASP.NET
application,
> it is giving System.IO.FileNotFoundException error. I tried mapping that
> server location like "H:\ErrorLogs\error.log" still it gives error. I
tried
> even giving the server name and directory like
> "\\server_name\\Directory\\file.log" still it gives file not found
exception.
> Does anyone help me fix this.
> Thanks
Monday, March 26, 2012
System.Net is not available in VS2005 Web project
I'm trying to access the System.Net.Mail namespace in an ASP.NET application (not website) and it's not available. Any ideas why not?
It is available in a different web site project, but not in an application.
Thanks,
Kahanu
make sure that a reference to System.dll assembly is exists in your application.
system.net.mail email tagged as spam!
Hi - I have a small room booking application running, where people logon, and book a room. THey should then get an email confirmation, sent directly from my web app (vb.net - .net2), which uses the system.net.mail class. However, I'm getting more and more people reporting they have not received the confirmation, and most recently, someone advising SPAMASSASSIN reported my email as being spam!
I'm not sure how this happens - as it's a request from someone for a booking, and all I'm doing is replying to their supplied email address, through my web app.
Is there some way I can add an identifier, to 'legitimise' my email?
Before asking, no, I'm not a spammer - I've posted several queries here over the last few years, and am a genuine developer - with a new problem to try and overcome.
Thanks for any help/pointers,
Mark
Im not sure of any ways to legitimize your messages, maybe its because of keywords that you are using in your subject line or body that is causing it to be filtered as spam, or maybe it is the web address you are sending it from.
Usually a subject line is a dead give away of spam though and many programs search for keywords in the subject and body to try to Identify spam, im sure if you search around on google you can find a keyword list and try to improve the context of your messages.
If that doesnt work then i am sorry i cant be much more help.
good luck :)
I'd try to contact SPAMASSASSIN or other anti-spam companies with your problem. I know of 1 other companies, Postini (http://www.postini.com/) which does anti-spam filtering for corporate email systems.
Hi - thanks for the suggestions so far - I will follow up where possible.
In the meantime, I read this (from a link on SPAMASSASSINS website):
"If your message is in HTML,DO include all of the MIME message headers that identify it as HTML. (You'd think this would be obvious, but mailers from the NY Times to Air Canada send HTML messages missing the mime-version header.)" fromhttp://spam.abuse.net/marketerhelp/bulk-howto.shtml
I'm not advocating it, as I'm not certain if it's trying to help, or tell you how to spam - but how from the system.net.mail webspace, how do you include MIME headers, and what should they contain?
Thanks, Mark
I've really done something on anti-spam research before.. Based on my understanding, i don't think it has anything to do with the "MIMI" message(note my suggestion could be WRONG).
i think in your case, the reason probably is that there are some not welcomed words exist in your mail thus cause your email recognized as a spam. So, maybe youshould first check the content of your mail(send the same email using another account like..yahoo..gmail..etc, and see if it's still recognized as spam)
Hope my suggestion helps
Hi BC - thanks.
Do you mean send to a GMAIL/Yahoo email address, or send from one - are there any programs which you can send some html to, to hilight the problem areas?
Thanks, Mark
and most recently, someone advising SPAMASSASSIN reported my email as being spam!
If you can still contact this "someone", send him/her the same confirmation email FROM a yahoo/hotmial/gmail account and see if it's still recognized as a spam. thanks
system.net.mail network host cache?
I need to change the name of the mail server for my .NET application. I changed it in web.config and on the .aspx page that sends the message. However, I still get an error message saying that the remote name could not be resolved, and the error message has the name of theold mail server. I have tried rebooting the server, but still get the same error.
Does .NET save configuration settings somewhere other than web.config? Is something getting cached? Other ideas?
Are you running VS debugger or testing on IIS server?
You can delete all files in cache.
Do you use only one config file?
If you have BLL and DAL, sometimes you have also config files here.
Visit this?site.
http://www.systemwebmail.com/
As Johan said, delete your temporary files, and build your web site again
Thanks
Thanks for the responses.
JohanNL, this site is on an IIS server. There is only one web.config file for the site. I did not implement BLL/DAL.
JohanNL and e_screw - this is probably a dumb question - when you say to delete cache/temp files, do you mean the ones in c:\windows\temp? Or what is the correct location?
You need to clear the ASP.NET temporary files
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
Thanks
System.Net.Mail library problems
Hi everyone, I'm newbie on ASP.net and I was trying to to an application to send emails with the following code using System.net.mail namespace:
PrivateSub Envio_Correo(ByVal rutaAsString)'Creando la instancia del mensajeDim correoAsMailMessage = nothingcorreo.From =
New MailAddress("b98123839@dotnet.itags.org.usmp.edu.pe")correo.To.Add(
"amonasiq@dotnet.itags.org.usmp.edu.pe")correo.Subject =
"Archivo de Confirmación de matricula"correo.Body =
"Se adjunto archivo de confirmación de matricula de su respectiva facultad"correo.IsBodyHtml =
False'correo.Attachments.Add(New Attachment(ruta))correo.Priority = MailPriority.Normal
'Crando la instancia del SMTP clienteDim smtpAsNew SmtpClientsmtp.Host =
"192.168.1.53"Trysmtp.Send(correo)
Catch exAs SmtpExceptionlMenErr.Text =
"Paso 4: Enviando el correo: " + ex.Message.ToString()lMenErr.ForeColor = System.Drawing.Color.Red
EndTryEndSubBut always get the same error: Mailbox unavailable. The server response was: Error: Message content rejected
But if i use the namespace system.web.mail with almost the same code:
PrivateSub enviar_correo_antiguo(ByVal rutaAsString,ByVal facuAsString)Dim correoAsNew MailMessageDim adjuntoAsNew MailAttachment(ruta)
correo.From =
"desarrollo@dotnet.itags.org.usmp.edu.pe"correo.To = Devolver_mail_ora(facu)
correo.Subject =
"Archivo de Confirmación de matricula"correo.Body =
"Se adjunto archivo de confirmación de matricula de su respectiva facultad"correo.Attachments.Add(adjunto)
SmtpMail.SmtpServer =
"192.168.1.53"TrySmtpMail.Send(correo)
Catch exAs ExceptionlMenErr.Text =
"Paso 5: Enviando el correo: " + ex.Message.ToString()lMenErr.ForeColor = System.Drawing.Color.Red
EndTryEndSubI dont have any problem at all, Could anyone tell me what is wrong in my code?
Sincerly
Kryor
system.web.mail = asp.net version 1.1system.net.mail= asp.net version 2.0
I know system.web is for framework 1.1 and system.net is for 2.0 but why is working with the old namespace and not with the new one being almost the same code.
each website can only run 1 framework- even if both are installed.
It seems your website is configured to run framework 1.1 ( thats my guess, based on what you posted )
There is a tab in IIS where you set the version for each website.
System.NET is through sockets so you may have to add more code. Try the link below for more about System.NET.Mail. Hope this helps.
http://www.systemnetmail.com/
System.Net.Mail.SmtpClient Send method causing an Application popu
thanks for your response. I checked my web.config and debug is set to
false. I did some searching on google for the proper reg key to modify
to disable this behavior, but was unsuccessful. Aside from needing to
figure out how to fix this, I'd love to also know *why* it's happening.
All other exceptions thrown in my web app get caught by exception
handlers except this one.
: (There is some unmanaged code stuff going on at the lower levels. My
experience with smtp and the .net controls led me to test locally and I had
to use devmail.net's product to get my sends to work. Even with a detail
trace on what was going on at the port level, I never could sort out my
issue. -greg
<ticketdirector@.gmail.com> wrote in message
news:1145937326.974099.280800@.i40g2000cwc.googlegroups.com...
> Peter,
> thanks for your response. I checked my web.config and debug is set to
> false. I did some searching on google for the proper reg key to modify
> to disable this behavior, but was unsuccessful. Aside from needing to
> figure out how to fix this, I'd love to also know *why* it's happening.
> All other exceptions thrown in my web app get caught by exception
> handlers except this one.
> : (
>
Saturday, March 24, 2012
System.Net.Sockets.SocketException: An established connection was aborted by the software
Hello, I got this error today in an Application. This app is coded in asp.net 2, using VB. I have the Andri Code (http://makoto.madmedia.ca/2007/03/mysql-membership-and-role-provider-for.html) to connect asp.net with mysql. It has never caused errors in the past, I have the same configuration on another app that has been running for several months with no problem.
This app is new (1 week) and today is the first day I see this error.
Any ideas?
Server Error in '/' Application.
------------------------
An established connection was aborted by the software in your host machine
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.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
Source Error:
Line 859:
Line 860:
Line 861: conn.Open();
Line 862: using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
Line 863: {
Source File: d:\appfolder\App_Code\CSCode\MySQLMembershipProvider.cs Line: 861
Stack Trace:
[SocketException (0x2745): An established connection was aborted by the software in your host machine]
System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) +1019099
MySql.Data.Common.SocketStream.Write(Byte[] buffer, Int32 offset, Int32 count) +22
System.IO.BufferedStream.FlushWrite() +21
System.IO.BufferedStream.Flush() +26
MySql.Data.MySqlClient.MySqlStream.Flush() +119
MySql.Data.MySqlClient.NativeDriver.ExecuteCommand(DBCmd cmd, Byte[] bytes, Int32 length) +114
MySql.Data.MySqlClient.NativeDriver.SetDatabase(String dbName) +29
MySql.Data.MySqlClient.MySqlConnection.ChangeDatabase(String database) +68
MySql.Data.MySqlClient.MySqlConnection.Open() +323
Andri.Web.MySqlMembershipProvider.ValidateUser(String username, String password) in d:\appfolder\App_Code\CSCode\MySQLMembershipProvider.cs:861
System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +160
System.Web.UI.WebControls.Login.AttemptLogin() +105
System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.ImageButton.OnCommand(CommandEventArgs e) +115
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +171
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.213
Do you have a firewall on your machine? This may be preventing your app from accessing MySQL via TCP/IP.
One other problem where I received this error was when I built a client/server app, and one machine had IPv6 protocol installed but the other machine had IPv4 (same domain/network). When I changed both to IPv4, it worked.
Hello, I have other apps with the same configuration running in the same machine so I think the firewall is not an option.
This is not a standalone app, it is a web app.
Hi vialetti,
I am afraid to say that it seems a bug said from MySql community. Here is link:http://bugs.mysql.com/bug.php?id=6634
Hope this helps. Thanks.
Thursday, March 22, 2012
System.NullReferenceException: Object reference not set to an inst
following error. And it hapeen, the whole web application gives this error,
that means all the aspx files get affected. Any ideas?
Here is the error:
Server Error in '/' 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 abou
t
the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set
to an instance of an object.
ASPX CODE:
<%@dotnet.itags.org. Page Language="JScript" Aspcompat="true" Debug="false"
Inherits="PETestTimeMSP" src="http://pics.10026.com/?src=source/pettmailmsp.js" %>
<%
pettMailMSP();
%>
<html>
<head>
<title>SCReliabilityServices Emailer</title>
</head>
<body>
SCReliabilityServices Emailer - Sent!
</body>
</html>
SOURCE CODE:
import System;
import System.Data;
import System.Data.OleDb;
import System.Web.UI;
import System.Web.UI.WebControls;
import System.Web.UI.HtmlControls;
import System.Text;
import System.Web.Mail;
import DBConn;
import LDAPCOM;
public class PETestTimeMSP extends Page {
public function sendMail(message : String, to : String) : void {
var Mailer : MailMessage = new MailMessage();
Mailer.Priority = MailPriority.Normal;
Mailer.BodyFormat = MailFormat.Html;
Mailer.From = "manager@dotnet.itags.org.email.com";
Mailer.To = to;
Mailer.Subject = "(MSP) DRTL PE Test Time Forecast - " + (new
Date().getMonth()+1) + "/" + new Date().getDate() + "/" + new
Date().getYear();
//Mailer.Body = "<font color=blue face=Arial size=-1>Starting today, you
will be receiving a daily report that should be beneficial in planning test
time<br>for jobs being stressed in DRTL.<br><br>The first part of the report
“Completed Stress – Pending Test” shows jobs that have completed stres
s
and<br>are pending test. For jobs in this status, electrical test has not
yet been completed - according to our database.<br>These will continue to
stay open, until data is provided to close.<br>If you have contacted our lab
on some of these jobs for closure, we are working on them.<br><b>Otherwise,
please contact Jennifer McClellan.</b><br><br>The second part of the report
“Forecast Readpoints for Test” is a forecast for jobs that are in<br>str
ess
and are expected to be completed within the next 5 days.<br>The time out on
the expected day is the end of the day.<br><br>Regards,<br>David
Kaase<br>DRTL Manager</font><br><br>" + message;
Mailer.Body = message;
SmtpMail.SmtpServer = "smtp.mail.ti.com";
SmtpMail.Send(Mailer);
}
public function pettMailMSP() : String {
var DBConnUtil : DBConnQDW = new DBConnQDW();
var dbconn : OleDbConnection = DBConnUtil.connectQDW();
var sql : String = "select d.relcode, d.jobtitle, d.pengrname,
d.pengremail, d.priority, t.testtype, t.testnum, r.grp, r.readnum, r.hrcy,
r.qty, to_char(k.sent, 'MM/DD/YYYY') sent, to_char(k.expecteddate,
'MM/DD/YYYY') expecteddate, k.location from rel_device d, rel_tests t,
rel_reads r, rel_track k where d.relcode = t.relcode and t.relcode =
r.relcode and t.testnum = r.testnum and r.relcode = k.relcode and r.testnum
=
k.testnum and r.grp = k.grp and r.readnum = k.readnum and d.dbname = 'MSPREL
'
and t.status = 'Active' and UPPER(t.programno) like 'ENG%' and k.complete is
null and k.location = 'PE Test'"
+ " union "
+ "select d.relcode, d.jobtitle, d.pengrname,
d.pengremail, d.priority, t.testtype, t.testnum, r.grp, r.readnum, r.hrcy,
r.qty, to_char(k.sent, 'MM/DD/YYYY') sent, to_char(k.expecteddate,
'MM/DD/YYYY') expecteddate, k.location from rel_device d, rel_tests t,
rel_reads r, rel_track k where d.relcode = t.relcode and t.relcode =
r.relcode and t.testnum = r.testnum and r.relcode = k.relcode and r.testnum
=
k.testnum and r.grp = k.grp and r.readnum = k.readnum and d.dbname = 'MSPREL
'
and t.status = 'Active' and ((t.testnum >= 0001 and t.testnum <= 0104) or
(t.testnum >= 1000 and t.testnum <= 1615) or (t.testnum >= 2000 and t.testnu
m
<= 2750) or (t.testnum >= 3000 and t.testnum <= 3240) or (t.testnum >= 3500
and t.testnum <= 3800) or (t.testnum >= 4075 and t.testnum <= 4322) or
(t.testnum = 9001)) and UPPER(t.programno) like 'ENG%' and k.expecteddate is
not null and k.expecteddate <= sysdate+5 and k.complete is null and
k.location like 'DRTL-%' order by 3, 5, 1, 6, 8, 12, 13";
var dbcmd : OleDbCommand = new OleDbCommand(sql, dbconn);
var dbRecords : OleDbDataReader = dbcmd.ExecuteReader();
var tableA : StringBuilder = new StringBuilder();
var tableB : StringBuilder = new StringBuilder();
var tableC : StringBuilder = new StringBuilder();
var tableS1 : StringBuilder = new StringBuilder();
var tableS2 : StringBuilder = new StringBuilder();
var tableS3 : StringBuilder = new StringBuilder();
var pengremail : String;
var relcodeA : String;
var relcodeB : String;
var expecteddate : String;
var tempdate : Date;
var ldaputil : LDAP = new LDAP();
while( dbRecords.Read() ) {
if( String.Compare(pengremail, dbRecords("pengremail")) != 0 ) {
if( String.Compare(pengremail, null) != 0 ) {
if( String.Compare(tableA.ToString(), "") != 0 ) {
tableA.Append("</table>");
tableC.Append(tableA.ToString());
tableC.Append("<br><br>");
}
if( String.Compare(tableB.ToString(), "") != 0 ) {
tableB.Append("</table>");
tableC.Append(tableB.ToString());
}
if( String.Compare(ldaputil.getLDAPValue('MAIL', pengremail,
'mail'), "") != 0 &&
String.Compare(tableC.ToString(), "") != 0 ) {
tableC.Append("<br>NOTE: This is an auto-generated
message!<br>");
sendMail(tableC.ToString(), pengremail);
}
}
pengremail = dbRecords("pengremail").ToString();
tableA = new StringBuilder();
tableB = new StringBuilder();
tableC = new StringBuilder();
}
if( String.Compare(dbRecords("location").ToString(), 'PE Test') == 0 ) {
if( String.Compare(tableS1.ToString(), "") == 0 ) {
tableS1.Append("<h2><font color=maroon>Completed Stress - Pending
Test</font></h2>");
tableS1.Append("<table width=75%>");
}
if( String.Compare(tableA.ToString(), "") == 0 ) {
tableA.Append("<h2><font color=maroon>Completed Stress - Pending
Test</font></h2>");
tableA.Append("<table width=75%>");
tableA.Append("<tr>");
tableA.Append("<td colspan=7><b>PE: " +
dbRecords("pengrname").ToString() + ":</b></td>");
tableA.Append("</tr>");
tableS1.Append("<tr>");
tableS1.Append("<td colspan=7><b>PE: " +
dbRecords("pengrname").ToString() + ":</b></td>");
tableS1.Append("</tr>");
}
if( String.Compare(relcodeA, dbRecords("relcode").ToString()) != 0 ) {
relcodeA = dbRecords("relcode").ToString();
tableA.Append("<tr>");
tableA.Append("<td colspan=5> <i><a
href='http://reldb.sc.ti.com/reldb/reldbmain.nsf/ShowJobDetail?OpenAgent&Rel
code="
+ relcodeA + "'>" + relcodeA + " — " +
dbRecords("jobtitle").ToString() + "</a></i></td>");
tableA.Append("</tr>");
tableA.Append("<tr>");
tableA.Append("<td align=center><font
size=-1><b>Test_Type</b></font></td>");
tableA.Append("<td align=center><font
size=-1><b>Hr/Cy</b></font></td>");
tableA.Append("<td align=center><font
size=-1><b>Grp</b></font></td>");
tableA.Append("<td align=center><font
size=-1><b>Qty</b></font></td>");
tableA.Append("<td align=center><font
size=-1><b>PE_Test</b></font></td>");
tableA.Append("</tr>");
tableS1.Append("<tr>");
tableS1.Append("<td colspan=5> <i><a
href='http://reldb.sc.ti.com/reldb/reldbmain.nsf/ShowJobDetail?OpenAgent&Rel
code="
+ relcodeA + "'>" + relcodeA + " — " +
dbRecords("jobtitle").ToString() + "</a></i></td>");
tableS1.Append("</tr>");
tableS1.Append("<tr>");
tableS1.Append("<td align=center><font
size=-1><b>Test_Type</b></font></td>");
tableS1.Append("<td align=center><font
size=-1><b>Hr/Cy</b></font></td>");
tableS1.Append("<td align=center><font
size=-1><b>Grp</b></font></td>");
tableS1.Append("<td align=center><font
size=-1><b>Qty</b></font></td>");
tableS1.Append("<td align=center><font
size=-1><b>PE_Test</b></font></td>");
tableS1.Append("</tr>");
}
tableA.Append("<tr>");
tableA.Append("<td align=center><font size=-1>" +
dbRecords("testtype").ToString() + "</font></td>");
tableA.Append("<td align=center><font size=-1>" +
dbRecords("hrcy").ToString() + "</font></td>");
tableA.Append("<td align=center><font size=-1>" +
dbRecords("grp").ToString() + "</font></td>");
tableA.Append("<td align=center><font size=-1>" +
dbRecords("qty").ToString() + "</font></td>");
tableA.Append("<td align=center><font size=-1>" +
dbRecords("sent").ToString() + "</font></td>");
tableA.Append("</tr>");
tableS1.Append("<tr>");
tableS1.Append("<td align=center><font size=-1>" +
dbRecords("testtype").ToString() + "</font></td>");
tableS1.Append("<td align=center><font size=-1>" +
dbRecords("hrcy").ToString() + "</font></td>");
tableS1.Append("<td align=center><font size=-1>" +
dbRecords("grp").ToString() + "</font></td>");
tableS1.Append("<td align=center><font size=-1>" +
dbRecords("qty").ToString() + "</font></td>");
tableS1.Append("<td align=center><font size=-1>" +
dbRecords("sent").ToString() + "</font></td>");
tableS1.Append("</tr>");
}
else {
expecteddate = dbRecords("expecteddate").ToString();
if( parseInt(dbRecords("testnum")) >= 1 &&
parseInt(dbRecords("testnum")) <= 104 ) {
sql = "select r_user from rel_reads where relcode = '" +
dbRecords("relcode") + "' and testnum = '" + dbRecords("testnum") + "' and
grp = '" + dbRecords("grp") + "' and readnum <= '" + dbRecords("readnum") +
"' and r_user like '%Soak%'";
var dbconnPrecon : OleDbConnection = DBConnUtil.connectQDW();
var dbcmdPrecon : OleDbCommand = new OleDbCommand(sql,
dbconnPrecon);
var dbRecordsPrecon : OleDbDataReader = dbcmdPrecon.ExecuteReader();
if( !dbRecordsPrecon.Read() ) {
dbRecordsPrecon.Close();
DBConnUtil.closeQDW(dbconnPrecon);
continue;
}
else {
tempdate = new Date(expecteddate);
tempdate.setHours(48);
if( tempdate > new Date().setHours(120) ) {
dbRecordsPrecon.Close();
DBConnUtil.closeQDW(dbconnPrecon);
continue;
}
else {
expecteddate = (new Date(tempdate).getMonth()+1) + "/" + new
Date(tempdate).getDate() + "/" + new Date(tempdate).getYear();
dbRecordsPrecon.Close();
DBConnUtil.closeQDW(dbconnPrecon);
}
}
}
if( String.Compare(tableS2.ToString(), "") == 0 ) {
tableS2.Append("<h2><font color=maroon>Forecast Readpoints for
Test</font></h2>");
tableS2.Append("<table width=75%>");
}
if( String.Compare(tableB.ToString(), "") == 0 ) {
tableB.Append("<h2><font color=maroon>Forecast Readpoints for
Test</font></h2>");
tableB.Append("<table width=75%>");
tableB.Append("<tr>");
tableB.Append("<td colspan=7><b>PE: " +
dbRecords("pengrname").ToString() + ":</b></td>");
tableB.Append("</tr>");
tableS2.Append("<tr>");
tableS2.Append("<td colspan=7><b>PE: " +
dbRecords("pengrname").ToString() + ":</b></td>");
tableS2.Append("</tr>");
}
if( String.Compare(relcodeB, dbRecords("relcode").ToString()) != 0 ) {
relcodeB = dbRecords("relcode").ToString();
tableB.Append("<tr>");
tableB.Append("<td colspan=5> <i><a
href='http://reldb.sc.ti.com/reldb/reldbmain.nsf/ShowJobDetail?OpenAgent&Rel
code="
+ relcodeB + "'>" + relcodeB + " — " +
dbRecords("jobtitle").ToString() + "</a></i></td>");
tableB.Append("</tr>");
tableB.Append("<tr>");
tableB.Append("<td align=center><font
size=-1><b>Test_Type</b></font></td>");
tableB.Append("<td align=center><font
size=-1><b>Hr/Cy</b></font></td>");
tableB.Append("<td align=center><font
size=-1><b>Grp</b></font></td>");
tableB.Append("<td align=center><font
size=-1><b>Qty</b></font></td>");
tableB.Append("<td align=center><font
size=-1><b>Expected_Date</b></font></td>");
tableB.Append("</tr>");
tableS2.Append("<tr>");
tableS2.Append("<td colspan=5> <i><a
href='http://reldb.sc.ti.com/reldb/reldbmain.nsf/ShowJobDetail?OpenAgent&Rel
code="
+ relcodeB + "'>" + relcodeB + " — " +
dbRecords("jobtitle").ToString() + "</a></i></td>");
tableS2.Append("</tr>");
tableS2.Append("<tr>");
tableS2.Append("<td align=center><font
size=-1><b>Test_Type</b></font></td>");
tableS2.Append("<td align=center><font
size=-1><b>Hr/Cy</b></font></td>");
tableS2.Append("<td align=center><font
size=-1><b>Grp</b></font></td>");
tableS2.Append("<td align=center><font
size=-1><b>Qty</b></font></td>");
tableS2.Append("<td align=center><font
size=-1><b>Expected_Date</b></font></td>");
tableS2.Append("</tr>");
}
tableB.Append("<tr>");
tableB.Append("<td align=center><font size=-1>" +
dbRecords("testtype").ToString() + "</font></td>");
tableB.Append("<td align=center><font size=-1>" +
dbRecords("hrcy").ToString() + "</font></td>");
tableB.Append("<td align=center><font size=-1>" +
dbRecords("grp").ToString() + "</font></td>");
tableB.Append("<td align=center><font size=-1>" +
dbRecords("qty").ToString() + "</font></td>");
tableB.Append("<td align=center><font size=-1>" + expecteddate +
"</font></td>");
tableB.Append("</tr>");
tableS2.Append("<tr>");
tableS2.Append("<td align=center><font size=-1>" +
dbRecords("testtype").ToString() + "</font></td>");
tableS2.Append("<td align=center><font size=-1>" +
dbRecords("hrcy").ToString() + "</font></td>");
tableS2.Append("<td align=center><font size=-1>" +
dbRecords("grp").ToString() + "</font></td>");
tableS2.Append("<td align=center><font size=-1>" +
dbRecords("qty").ToString() + "</font></td>");
tableS2.Append("<td align=center><font size=-1>" + expecteddate +
"</font></td>");
tableS2.Append("</tr>");
}
}
if( String.Compare(tableA.ToString(), "") != 0 ) {
tableA.Append("</table>");
tableC.Append(tableA.ToString());
tableC.Append("<br><br>");
}
if( String.Compare(tableB.ToString(), "") != 0 ) {
tableB.Append("</table>");
tableC.Append(tableB.ToString());
}
if( String.Compare(ldaputil.getLDAPValue('MAIL', pengremail, 'mail'),
"") != 0 &&
String.Compare(tableC.ToString(), "") != 0 ) {
tableC.Append("<br>NOTE: This is an auto-generated message!<br>");
sendMail(tableC.ToString(), pengremail);
}
if( String.Compare(tableS1.ToString(), "") != 0 ) {
tableS1.Append("</table>");
tableS3.Append(tableS1.ToString());
tableS3.Append("<br><br>");
}
if( String.Compare(tableS2.ToString(), "") != 0 ) {
tableS2.Append("</table>");
tableS3.Append(tableS2.ToString());
}
tableS3.Append("<br>NOTE: This is an auto-generated message!<br>");
sendMail("***Summary to Lab Manager***<br><br>" + tableS3.ToString(),
'manager@dotnet.itags.org.email.com');
dbRecords.Close();
DBConnUtil.closeQDW(dbconn);
}
}A couple of things:
Note the following in the error message:
> Please review the stack trace for more information about
> the error and where it originated in the code.
Note the following in your @.Page directive:
> <%@. Page Language="JScript" Aspcompat="true" Debug="false"
> Inherits="PETestTimeMSP" src="http://pics.10026.com/?src=source/pettmailmsp.js" %>
Turing Debugging ON should give you the stack trace that will indicate the
line of code that threw the exception. From there it's simple.
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.
"Ben" <Ben@.discussions.microsoft.com> wrote in message
news:1AF1D1E9-E17A-40CC-BB81-94C2BD4E645F@.microsoft.com...
>I have several pages written in aspx, but sometime the aspx page return the
> following error. And it hapeen, the whole web application gives this
> error,
> that means all the aspx files get affected. Any ideas?
> Here is the error:
> Server Error in '/' 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.
> ASPX CODE:
> <%@. Page Language="JScript" Aspcompat="true" Debug="false"
> Inherits="PETestTimeMSP" src="http://pics.10026.com/?src=source/pettmailmsp.js" %>
> <%
> pettMailMSP();
> %>
> <html>
> <head>
> <title>SCReliabilityServices Emailer</title>
> </head>
> <body>
> SCReliabilityServices Emailer - Sent!
> </body>
> </html>
> SOURCE CODE:
> import System;
> import System.Data;
> import System.Data.OleDb;
> import System.Web.UI;
> import System.Web.UI.WebControls;
> import System.Web.UI.HtmlControls;
> import System.Text;
> import System.Web.Mail;
> import DBConn;
> import LDAPCOM;
> public class PETestTimeMSP extends Page {
> public function sendMail(message : String, to : String) : void {
> var Mailer : MailMessage = new MailMessage();
> Mailer.Priority = MailPriority.Normal;
> Mailer.BodyFormat = MailFormat.Html;
> Mailer.From = "manager@.email.com";
> Mailer.To = to;
> Mailer.Subject = "(MSP) DRTL PE Test Time Forecast - " + (new
> Date().getMonth()+1) + "/" + new Date().getDate() + "/" + new
> Date().getYear();
> //Mailer.Body = "<font color=blue face=Arial size=-1>Starting today,
> you
> will be receiving a daily report that should be beneficial in planning
> test
> time<br>for jobs being stressed in DRTL.<br><br>The first part of the
> report
> "Completed Stress - Pending Test" shows jobs that have completed stress
> and<br>are pending test. For jobs in this status, electrical test has not
> yet been completed - according to our database.<br>These will continue to
> stay open, until data is provided to close.<br>If you have contacted our
> lab
> on some of these jobs for closure, we are working on
> them.<br><b>Otherwise,
> please contact Jennifer McClellan.</b><br><br>The second part of the
> report
> "Forecast Readpoints for Test" is a forecast for jobs that are
> in<br>stress
> and are expected to be completed within the next 5 days.<br>The time out
> on
> the expected day is the end of the day.<br><br>Regards,<br>David
> Kaase<br>DRTL Manager<br><br>" + message;
> Mailer.Body = message;
> SmtpMail.SmtpServer = "smtp.mail.ti.com";
> SmtpMail.Send(Mailer);
> }
> public function pettMailMSP() : String {
> var DBConnUtil : DBConnQDW = new DBConnQDW();
> var dbconn : OleDbConnection = DBConnUtil.connectQDW();
> var sql : String = "select d.relcode, d.jobtitle, d.pengrname,
> d.pengremail, d.priority, t.testtype, t.testnum, r.grp, r.readnum, r.hrcy,
> r.qty, to_char(k.sent, 'MM/DD/YYYY') sent, to_char(k.expecteddate,
> 'MM/DD/YYYY') expecteddate, k.location from rel_device d, rel_tests t,
> rel_reads r, rel_track k where d.relcode = t.relcode and t.relcode =
> r.relcode and t.testnum = r.testnum and r.relcode = k.relcode and
> r.testnum =
> k.testnum and r.grp = k.grp and r.readnum = k.readnum and d.dbname =
> 'MSPREL'
> and t.status = 'Active' and UPPER(t.programno) like 'ENG%' and k.complete
> is
> null and k.location = 'PE Test'"
> + " union "
> + "select d.relcode, d.jobtitle, d.pengrname,
> d.pengremail, d.priority, t.testtype, t.testnum, r.grp, r.readnum, r.hrcy,
> r.qty, to_char(k.sent, 'MM/DD/YYYY') sent, to_char(k.expecteddate,
> 'MM/DD/YYYY') expecteddate, k.location from rel_device d, rel_tests t,
> rel_reads r, rel_track k where d.relcode = t.relcode and t.relcode =
> r.relcode and t.testnum = r.testnum and r.relcode = k.relcode and
> r.testnum =
> k.testnum and r.grp = k.grp and r.readnum = k.readnum and d.dbname =
> 'MSPREL'
> and t.status = 'Active' and ((t.testnum >= 0001 and t.testnum <= 0104) or
> (t.testnum >= 1000 and t.testnum <= 1615) or (t.testnum >= 2000 and
> t.testnum
> <= 2750) or (t.testnum >= 3000 and t.testnum <= 3240) or (t.testnum >=
> 3500
> and t.testnum <= 3800) or (t.testnum >= 4075 and t.testnum <= 4322) or
> (t.testnum = 9001)) and UPPER(t.programno) like 'ENG%' and k.expecteddate
> is
> not null and k.expecteddate <= sysdate+5 and k.complete is null and
> k.location like 'DRTL-%' order by 3, 5, 1, 6, 8, 12, 13";
> var dbcmd : OleDbCommand = new OleDbCommand(sql, dbconn);
> var dbRecords : OleDbDataReader = dbcmd.ExecuteReader();
> var tableA : StringBuilder = new StringBuilder();
> var tableB : StringBuilder = new StringBuilder();
> var tableC : StringBuilder = new StringBuilder();
> var tableS1 : StringBuilder = new StringBuilder();
> var tableS2 : StringBuilder = new StringBuilder();
> var tableS3 : StringBuilder = new StringBuilder();
> var pengremail : String;
> var relcodeA : String;
> var relcodeB : String;
> var expecteddate : String;
> var tempdate : Date;
> var ldaputil : LDAP = new LDAP();
> while( dbRecords.Read() ) {
> if( String.Compare(pengremail, dbRecords("pengremail")) != 0 ) {
> if( String.Compare(pengremail, null) != 0 ) {
> if( String.Compare(tableA.ToString(), "") != 0 ) {
> tableA.Append("</table>");
> tableC.Append(tableA.ToString());
> tableC.Append("<br><br>");
> }
> if( String.Compare(tableB.ToString(), "") != 0 ) {
> tableB.Append("</table>");
> tableC.Append(tableB.ToString());
> }
> if( String.Compare(ldaputil.getLDAPValue('MAIL', pengremail,
> 'mail'), "") != 0 &&
> String.Compare(tableC.ToString(), "") != 0 ) {
> tableC.Append("<br>NOTE: This is an auto-generated
> message!<br>");
> sendMail(tableC.ToString(), pengremail);
> }
> }
> pengremail = dbRecords("pengremail").ToString();
> tableA = new StringBuilder();
> tableB = new StringBuilder();
> tableC = new StringBuilder();
> }
> if( String.Compare(dbRecords("location").ToString(), 'PE Test') ==
> 0 ) {
> if( String.Compare(tableS1.ToString(), "") == 0 ) {
> tableS1.Append("<h2><font color=maroon>Completed Stress - Pending
> Test</h2>");
> tableS1.Append("<table width=75%>");
> }
> if( String.Compare(tableA.ToString(), "") == 0 ) {
> tableA.Append("<h2><font color=maroon>Completed Stress - Pending
> Test</h2>");
> tableA.Append("<table width=75%>");
> tableA.Append("<tr>");
> tableA.Append("<td colspan=7><b>PE: " +
> dbRecords("pengrname").ToString() + ":</b></td>");
> tableA.Append("</tr>");
> tableS1.Append("<tr>");
> tableS1.Append("<td colspan=7><b>PE: " +
> dbRecords("pengrname").ToString() + ":</b></td>");
> tableS1.Append("</tr>");
> }
> if( String.Compare(relcodeA, dbRecords("relcode").ToString()) !=
> 0 ) {
> relcodeA = dbRecords("relcode").ToString();
> tableA.Append("<tr>");
> tableA.Append("<td colspan=5> <i><a
> href='http://reldb.sc.ti.com/reldb/reldbmain.nsf/ShowJobDetail?OpenAgent&R
elcode="
> + relcodeA + "'>" + relcodeA + " - " +
> dbRecords("jobtitle").ToString() + "</a></i></td>");
> tableA.Append("</tr>");
> tableA.Append("<tr>");
> tableA.Append("<td align=center><font
> size=-1><b>Test_Type</b></td>");
> tableA.Append("<td align=center><font
> size=-1><b>Hr/Cy</b></td>");
> tableA.Append("<td align=center><font
> size=-1><b>Grp</b></td>");
> tableA.Append("<td align=center><font
> size=-1><b>Qty</b></td>");
> tableA.Append("<td align=center><font
> size=-1><b>PE_Test</b></td>");
> tableA.Append("</tr>");
> tableS1.Append("<tr>");
> tableS1.Append("<td colspan=5> <i><a
> href='http://reldb.sc.ti.com/reldb/reldbmain.nsf/ShowJobDetail?OpenAgent&R
elcode="
> + relcodeA + "'>" + relcodeA + " - " +
> dbRecords("jobtitle").ToString() + "</a></i></td>");
> tableS1.Append("</tr>");
> tableS1.Append("<tr>");
> tableS1.Append("<td align=center><font
> size=-1><b>Test_Type</b></td>");
> tableS1.Append("<td align=center><font
> size=-1><b>Hr/Cy</b></td>");
> tableS1.Append("<td align=center><font
> size=-1><b>Grp</b></td>");
> tableS1.Append("<td align=center><font
> size=-1><b>Qty</b></td>");
> tableS1.Append("<td align=center><font
> size=-1><b>PE_Test</b></td>");
> tableS1.Append("</tr>");
> }
> tableA.Append("<tr>");
> tableA.Append("<td align=center><font size=-1>" +
> dbRecords("testtype").ToString() + "</td>");
> tableA.Append("<td align=center><font size=-1>" +
> dbRecords("hrcy").ToString() + "</td>");
> tableA.Append("<td align=center><font size=-1>" +
> dbRecords("grp").ToString() + "</td>");
> tableA.Append("<td align=center><font size=-1>" +
> dbRecords("qty").ToString() + "</td>");
> tableA.Append("<td align=center><font size=-1>" +
> dbRecords("sent").ToString() + "</td>");
> tableA.Append("</tr>");
> tableS1.Append("<tr>");
> tableS1.Append("<td align=center><font size=-1>" +
> dbRecords("testtype").ToString() + "</td>");
> tableS1.Append("<td align=center><font size=-1>" +
> dbRecords("hrcy").ToString() + "</td>");
> tableS1.Append("<td align=center><font size=-1>" +
> dbRecords("grp").ToString() + "</td>");
> tableS1.Append("<td align=center><font size=-1>" +
> dbRecords("qty").ToString() + "</td>");
> tableS1.Append("<td align=center><font size=-1>" +
> dbRecords("sent").ToString() + "</td>");
> tableS1.Append("</tr>");
> }
> else {
> expecteddate = dbRecords("expecteddate").ToString();
> if( parseInt(dbRecords("testnum")) >= 1 &&
> parseInt(dbRecords("testnum")) <= 104 ) {
> sql = "select r_user from rel_reads where relcode = '" +
> dbRecords("relcode") + "' and testnum = '" + dbRecords("testnum") + "' and
> grp = '" + dbRecords("grp") + "' and readnum <= '" + dbRecords("readnum")
> +
> "' and r_user like '%Soak%'";
> var dbconnPrecon : OleDbConnection = DBConnUtil.connectQDW();
> var dbcmdPrecon : OleDbCommand = new OleDbCommand(sql,
> dbconnPrecon);
> var dbRecordsPrecon : OleDbDataReader =
> dbcmdPrecon.ExecuteReader();
> if( !dbRecordsPrecon.Read() ) {
> dbRecordsPrecon.Close();
> DBConnUtil.closeQDW(dbconnPrecon);
> continue;
> }
> else {
> tempdate = new Date(expecteddate);
> tempdate.setHours(48);
> if( tempdate > new Date().setHours(120) ) {
> dbRecordsPrecon.Close();
> DBConnUtil.closeQDW(dbconnPrecon);
> continue;
> }
> else {
> expecteddate = (new Date(tempdate).getMonth()+1) + "/" + new
> Date(tempdate).getDate() + "/" + new Date(tempdate).getYear();
> dbRecordsPrecon.Close();
> DBConnUtil.closeQDW(dbconnPrecon);
> }
> }
> }
> if( String.Compare(tableS2.ToString(), "") == 0 ) {
> tableS2.Append("<h2><font color=maroon>Forecast Readpoints for
> Test</h2>");
> tableS2.Append("<table width=75%>");
> }
> if( String.Compare(tableB.ToString(), "") == 0 ) {
> tableB.Append("<h2><font color=maroon>Forecast Readpoints for
> Test</h2>");
> tableB.Append("<table width=75%>");
> tableB.Append("<tr>");
> tableB.Append("<td colspan=7><b>PE: " +
> dbRecords("pengrname").ToString() + ":</b></td>");
> tableB.Append("</tr>");
> tableS2.Append("<tr>");
> tableS2.Append("<td colspan=7><b>PE: " +
> dbRecords("pengrname").ToString() + ":</b></td>");
> tableS2.Append("</tr>");
> }
> if( String.Compare(relcodeB, dbRecords("relcode").ToString()) !=
> 0 ) {
> relcodeB = dbRecords("relcode").ToString();
> tableB.Append("<tr>");
> tableB.Append("<td colspan=5> <i><a
> href='http://reldb.sc.ti.com/reldb/reldbmain.nsf/ShowJobDetail?OpenAgent&R
elcode="
> + relcodeB + "'>" + relcodeB + " - " +
> dbRecords("jobtitle").ToString() + "</a></i></td>");
> tableB.Append("</tr>");
> tableB.Append("<tr>");
> tableB.Append("<td align=center><font
> size=-1><b>Test_Type</b></td>");
> tableB.Append("<td align=center><font
> size=-1><b>Hr/Cy</b></td>");
> tableB.Append("<td align=center><font
> size=-1><b>Grp</b></td>");
> tableB.Append("<td align=center><font
> size=-1><b>Qty</b></td>");
> tableB.Append("<td align=center><font
> size=-1><b>Expected_Date</b></td>");
> tableB.Append("</tr>");
> tableS2.Append("<tr>");
> tableS2.Append("<td colspan=5> <i><a
> href='http://reldb.sc.ti.com/reldb/reldbmain.nsf/ShowJobDetail?OpenAgent&R
elcode="
> + relcodeB + "'>" + relcodeB + " - " +
> dbRecords("jobtitle").ToString() + "</a></i></td>");
> tableS2.Append("</tr>");
> tableS2.Append("<tr>");
> tableS2.Append("<td align=center><font
> size=-1><b>Test_Type</b></td>");
> tableS2.Append("<td align=center><font
> size=-1><b>Hr/Cy</b></td>");
> tableS2.Append("<td align=center><font
> size=-1><b>Grp</b></td>");
> tableS2.Append("<td align=center><font
> size=-1><b>Qty</b></td>");
> tableS2.Append("<td align=center><font
> size=-1><b>Expected_Date</b></td>");
> tableS2.Append("</tr>");
> }
> tableB.Append("<tr>");
> tableB.Append("<td align=center><font size=-1>" +
> dbRecords("testtype").ToString() + "</td>");
> tableB.Append("<td align=center><font size=-1>" +
> dbRecords("hrcy").ToString() + "</td>");
> tableB.Append("<td align=center><font size=-1>" +
> dbRecords("grp").ToString() + "</td>");
> tableB.Append("<td align=center><font size=-1>" +
> dbRecords("qty").ToString() + "</td>");
> tableB.Append("<td align=center><font size=-1>" + expecteddate +
> "</td>");
> tableB.Append("</tr>");
> tableS2.Append("<tr>");
> tableS2.Append("<td align=center><font size=-1>" +
> dbRecords("testtype").ToString() + "</td>");
> tableS2.Append("<td align=center><font size=-1>" +
> dbRecords("hrcy").ToString() + "</td>");
> tableS2.Append("<td align=center><font size=-1>" +
> dbRecords("grp").ToString() + "</td>");
> tableS2.Append("<td align=center><font size=-1>" +
> dbRecords("qty").ToString() + "</td>");
> tableS2.Append("<td align=center><font size=-1>" + expecteddate +
> "</td>");
> tableS2.Append("</tr>");
> }
> }
> if( String.Compare(tableA.ToString(), "") != 0 ) {
> tableA.Append("</table>");
> tableC.Append(tableA.ToString());
> tableC.Append("<br><br>");
> }
> if( String.Compare(tableB.ToString(), "") != 0 ) {
> tableB.Append("</table>");
> tableC.Append(tableB.ToString());
> }
> if( String.Compare(ldaputil.getLDAPValue('MAIL', pengremail, 'mail'),
> "") != 0 &&
> String.Compare(tableC.ToString(), "") != 0 ) {
> tableC.Append("<br>NOTE: This is an auto-generated message!<br>");
> sendMail(tableC.ToString(), pengremail);
> }
> if( String.Compare(tableS1.ToString(), "") != 0 ) {
> tableS1.Append("</table>");
> tableS3.Append(tableS1.ToString());
> tableS3.Append("<br><br>");
> }
> if( String.Compare(tableS2.ToString(), "") != 0 ) {
> tableS2.Append("</table>");
> tableS3.Append(tableS2.ToString());
> }
> tableS3.Append("<br>NOTE: This is an auto-generated message!<br>");
> sendMail("***Summary to Lab Manager***<br><br>" + tableS3.ToString(),
> 'manager@.email.com');
> dbRecords.Close();
> DBConnUtil.closeQDW(dbconn);
> }
> }
>
Adam,
This is aspnet user group. <%# %> code is ASP. Yes a few things are still
used <% %> this is only available for backwards compatibility not new
development.
Use the page_load or Page_render events for processing the querry string
into your control.
Bad luck
"Adam Knight" wrote:
> Hi all,
> I have the following peice of code:
> Esssentially, a querystring containing a comma separated list of values is
> used to populate the appropriate intSectionID property of a user control.
> <% If Not(Request.QueryString("SectionID") Is Nothing) Then %>
> <% arrSectionID = Split(Request.QueryString("SectionID"), ",") %>
> <Company:Links ID="LevelTwo" intSectionID="<%# arrSectionID(0) %>"
> Runat="Server"/>
> <% End If %>
> However i keep gettting the error listed in my post..
> Can someone fill me in on what could be going wrong?
> I have a suspicion it may be occuring when the User Controls DataBind meth
od
> is called.
> The variable is visible to the parent page, but not the user control'
> Suggest a way to fix?
> Cheers,
> Adam
>
>
System.NullReferenceException: Object reference not set to an inst
following error. And it hapeen, the whole web application gives this error,
that means all the aspx files get affected. Any ideas?
Here is the error:
Server Error in '/' 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.
ASPX CODE:
<%@dotnet.itags.org. Page Language="JScript" Aspcompat="true" Debug="false"
Inherits="PETestTimeMSP" src="http://pics.10026.com/?src=source/pettmailmsp.js" %>
<%
pettMailMSP();
%
<html>
<head>
<title>SCReliabilityServices Emailer</title>
</head>
<body>
SCReliabilityServices Emailer - Sent!
</body>
</html
SOURCE CODE:
import System;
import System.Data;
import System.Data.OleDb;
import System.Web.UI;
import System.Web.UI.WebControls;
import System.Web.UI.HtmlControls;
import System.Text;
import System.Web.Mail;
import DBConn;
import LDAPCOM;
public class PETestTimeMSP extends Page {
public function sendMail(message : String, to : String) : void {
var Mailer : MailMessage = new MailMessage();
Mailer.Priority = MailPriority.Normal;
Mailer.BodyFormat = MailFormat.Html;
Mailer.From = "manager@dotnet.itags.org.email.com";
Mailer.To = to;
Mailer.Subject = "(MSP) DRTL PE Test Time Forecast - " + (new
Date().getMonth()+1) + "/" + new Date().getDate() + "/" + new
Date().getYear();
//Mailer.Body = "<font color=blue face=Arial size=-1>Starting today, you
will be receiving a daily report that should be beneficial in planning test
time<br>for jobs being stressed in DRTL.<br><br>The first part of the report
"Completed Stress – Pending Test" shows jobs that have completed stress
and<br>are pending test. For jobs in this status, electrical test has not
yet been completed - according to our database.<br>These will continue to
stay open, until data is provided to close.<br>If you have contacted our lab
on some of these jobs for closure, we are working on them.<br><b>Otherwise,
please contact Jennifer McClellan.</b><br><br>The second part of the report
"Forecast Readpoints for Test" is a forecast for jobs that are in<br>stress
and are expected to be completed within the next 5 days.<br>The time out on
the expected day is the end of the day.<br><br>Regards,<br>David
Kaase<br>DRTL Manager</font><br><br>" + message;
Mailer.Body = message;
SmtpMail.SmtpServer = "smtp.mail.ti.com";
SmtpMail.Send(Mailer);
}
public function pettMailMSP() : String {
var DBConnUtil : DBConnQDW = new DBConnQDW();
var dbconn : OleDbConnection = DBConnUtil.connectQDW();
var sql : String = "select d.relcode, d.jobtitle, d.pengrname,
d.pengremail, d.priority, t.testtype, t.testnum, r.grp, r.readnum, r.hrcy,
r.qty, to_char(k.sent, 'MM/DD/YYYY') sent, to_char(k.expecteddate,
'MM/DD/YYYY') expecteddate, k.location from rel_device d, rel_tests t,
rel_reads r, rel_track k where d.relcode = t.relcode and t.relcode =
r.relcode and t.testnum = r.testnum and r.relcode = k.relcode and r.testnum =
k.testnum and r.grp = k.grp and r.readnum = k.readnum and d.dbname = 'MSPREL'
and t.status = 'Active' and UPPER(t.programno) like 'ENG%' and k.complete is
null and k.location = 'PE Test'"
+ " union "
+ "select d.relcode, d.jobtitle, d.pengrname,
d.pengremail, d.priority, t.testtype, t.testnum, r.grp, r.readnum, r.hrcy,
r.qty, to_char(k.sent, 'MM/DD/YYYY') sent, to_char(k.expecteddate,
'MM/DD/YYYY') expecteddate, k.location from rel_device d, rel_tests t,
rel_reads r, rel_track k where d.relcode = t.relcode and t.relcode =
r.relcode and t.testnum = r.testnum and r.relcode = k.relcode and r.testnum =
k.testnum and r.grp = k.grp and r.readnum = k.readnum and d.dbname = 'MSPREL'
and t.status = 'Active' and ((t.testnum >= 0001 and t.testnum <= 0104) or
(t.testnum >= 1000 and t.testnum <= 1615) or (t.testnum >= 2000 and t.testnum
<= 2750) or (t.testnum >= 3000 and t.testnum <= 3240) or (t.testnum >= 3500
and t.testnum <= 3800) or (t.testnum >= 4075 and t.testnum <= 4322) or
(t.testnum = 9001)) and UPPER(t.programno) like 'ENG%' and k.expecteddate is
not null and k.expecteddate <= sysdate+5 and k.complete is null and
k.location like 'DRTL-%' order by 3, 5, 1, 6, 8, 12, 13";
var dbcmd : OleDbCommand = new OleDbCommand(sql, dbconn);
var dbRecords : OleDbDataReader = dbcmd.ExecuteReader();
var tableA : StringBuilder = new StringBuilder();
var tableB : StringBuilder = new StringBuilder();
var tableC : StringBuilder = new StringBuilder();
var tableS1 : StringBuilder = new StringBuilder();
var tableS2 : StringBuilder = new StringBuilder();
var tableS3 : StringBuilder = new StringBuilder();
var pengremail : String;
var relcodeA : String;
var relcodeB : String;
var expecteddate : String;
var tempdate : Date;
var ldaputil : LDAP = new LDAP();
while( dbRecords.Read() ) {
if( String.Compare(pengremail, dbRecords("pengremail")) != 0 ) {
if( String.Compare(pengremail, null) != 0 ) {
if( String.Compare(tableA.ToString(), "") != 0 ) {
tableA.Append("</table>");
tableC.Append(tableA.ToString());
tableC.Append("<br><br>");
}
if( String.Compare(tableB.ToString(), "") != 0 ) {
tableB.Append("</table>");
tableC.Append(tableB.ToString());
}
if( String.Compare(ldaputil.getLDAPValue('MAIL', pengremail,
'mail'), "") != 0 &&
String.Compare(tableC.ToString(), "") != 0 ) {
tableC.Append("<br>NOTE: This is an auto-generated
message!<br>");
sendMail(tableC.ToString(), pengremail);
}
}
pengremail = dbRecords("pengremail").ToString();
tableA = new StringBuilder();
tableB = new StringBuilder();
tableC = new StringBuilder();
}
if( String.Compare(dbRecords("location").ToString(), 'PE Test') == 0 ) {
if( String.Compare(tableS1.ToString(), "") == 0 ) {
tableS1.Append("<h2><font color=maroon>Completed Stress - Pending
Test</font></h2>");
tableS1.Append("<table width=75%>");
}
if( String.Compare(tableA.ToString(), "") == 0 ) {
tableA.Append("<h2><font color=maroon>Completed Stress - Pending
Test</font></h2>");
tableA.Append("<table width=75%>");
tableA.Append("<tr>");
tableA.Append("<td colspan=7><b>PE: " +
dbRecords("pengrname").ToString() + ":</b></td>");
tableA.Append("</tr>");
tableS1.Append("<tr>");
tableS1.Append("<td colspan=7><b>PE: " +
dbRecords("pengrname").ToString() + ":</b></td>");
tableS1.Append("</tr>");
}
if( String.Compare(relcodeA, dbRecords("relcode").ToString()) != 0 ) {
relcodeA = dbRecords("relcode").ToString();
tableA.Append("<tr>");
tableA.Append("<td colspan=5> <i><a
href='http://reldb.sc.ti.com/reldb/reldbmain.nsf/ShowJobDetail?OpenAgent&Relcode="
+ relcodeA + "'>" + relcodeA + " — " +
dbRecords("jobtitle").ToString() + "</a></i></td>");
tableA.Append("</tr>");
tableA.Append("<tr>");
tableA.Append("<td align=center><font
size=-1><b>Test_Type</b></font></td>");
tableA.Append("<td align=center><font
size=-1><b>Hr/Cy</b></font></td>");
tableA.Append("<td align=center><font
size=-1><b>Grp</b></font></td>");
tableA.Append("<td align=center><font
size=-1><b>Qty</b></font></td>");
tableA.Append("<td align=center><font
size=-1><b>PE_Test</b></font></td>");
tableA.Append("</tr>");
tableS1.Append("<tr>");
tableS1.Append("<td colspan=5> <i><a
href='http://reldb.sc.ti.com/reldb/reldbmain.nsf/ShowJobDetail?OpenAgent&Relcode="
+ relcodeA + "'>" + relcodeA + " — " +
dbRecords("jobtitle").ToString() + "</a></i></td>");
tableS1.Append("</tr>");
tableS1.Append("<tr>");
tableS1.Append("<td align=center><font
size=-1><b>Test_Type</b></font></td>");
tableS1.Append("<td align=center><font
size=-1><b>Hr/Cy</b></font></td>");
tableS1.Append("<td align=center><font
size=-1><b>Grp</b></font></td>");
tableS1.Append("<td align=center><font
size=-1><b>Qty</b></font></td>");
tableS1.Append("<td align=center><font
size=-1><b>PE_Test</b></font></td>");
tableS1.Append("</tr>");
}
tableA.Append("<tr>");
tableA.Append("<td align=center><font size=-1>" +
dbRecords("testtype").ToString() + "</font></td>");
tableA.Append("<td align=center><font size=-1>" +
dbRecords("hrcy").ToString() + "</font></td>");
tableA.Append("<td align=center><font size=-1>" +
dbRecords("grp").ToString() + "</font></td>");
tableA.Append("<td align=center><font size=-1>" +
dbRecords("qty").ToString() + "</font></td>");
tableA.Append("<td align=center><font size=-1>" +
dbRecords("sent").ToString() + "</font></td>");
tableA.Append("</tr>");
tableS1.Append("<tr>");
tableS1.Append("<td align=center><font size=-1>" +
dbRecords("testtype").ToString() + "</font></td>");
tableS1.Append("<td align=center><font size=-1>" +
dbRecords("hrcy").ToString() + "</font></td>");
tableS1.Append("<td align=center><font size=-1>" +
dbRecords("grp").ToString() + "</font></td>");
tableS1.Append("<td align=center><font size=-1>" +
dbRecords("qty").ToString() + "</font></td>");
tableS1.Append("<td align=center><font size=-1>" +
dbRecords("sent").ToString() + "</font></td>");
tableS1.Append("</tr>");
}
else {
expecteddate = dbRecords("expecteddate").ToString();
if( parseInt(dbRecords("testnum")) >= 1 &&
parseInt(dbRecords("testnum")) <= 104 ) {
sql = "select r_user from rel_reads where relcode = '" +
dbRecords("relcode") + "' and testnum = '" + dbRecords("testnum") + "' and
grp = '" + dbRecords("grp") + "' and readnum <= '" + dbRecords("readnum") +
"' and r_user like '%Soak%'";
var dbconnPrecon : OleDbConnection = DBConnUtil.connectQDW();
var dbcmdPrecon : OleDbCommand = new OleDbCommand(sql,
dbconnPrecon);
var dbRecordsPrecon : OleDbDataReader = dbcmdPrecon.ExecuteReader();
if( !dbRecordsPrecon.Read() ) {
dbRecordsPrecon.Close();
DBConnUtil.closeQDW(dbconnPrecon);
continue;
}
else {
tempdate = new Date(expecteddate);
tempdate.setHours(48);
if( tempdate > new Date().setHours(120) ) {
dbRecordsPrecon.Close();
DBConnUtil.closeQDW(dbconnPrecon);
continue;
}
else {
expecteddate = (new Date(tempdate).getMonth()+1) + "/" + new
Date(tempdate).getDate() + "/" + new Date(tempdate).getYear();
dbRecordsPrecon.Close();
DBConnUtil.closeQDW(dbconnPrecon);
}
}
}
if( String.Compare(tableS2.ToString(), "") == 0 ) {
tableS2.Append("<h2><font color=maroon>Forecast Readpoints for
Test</font></h2>");
tableS2.Append("<table width=75%>");
}
if( String.Compare(tableB.ToString(), "") == 0 ) {
tableB.Append("<h2><font color=maroon>Forecast Readpoints for
Test</font></h2>");
tableB.Append("<table width=75%>");
tableB.Append("<tr>");
tableB.Append("<td colspan=7><b>PE: " +
dbRecords("pengrname").ToString() + ":</b></td>");
tableB.Append("</tr>");
tableS2.Append("<tr>");
tableS2.Append("<td colspan=7><b>PE: " +
dbRecords("pengrname").ToString() + ":</b></td>");
tableS2.Append("</tr>");
}
if( String.Compare(relcodeB, dbRecords("relcode").ToString()) != 0 ) {
relcodeB = dbRecords("relcode").ToString();
tableB.Append("<tr>");
tableB.Append("<td colspan=5> <i><a
href='http://reldb.sc.ti.com/reldb/reldbmain.nsf/ShowJobDetail?OpenAgent&Relcode="
+ relcodeB + "'>" + relcodeB + " — " +
dbRecords("jobtitle").ToString() + "</a></i></td>");
tableB.Append("</tr>");
tableB.Append("<tr>");
tableB.Append("<td align=center><font
size=-1><b>Test_Type</b></font></td>");
tableB.Append("<td align=center><font
size=-1><b>Hr/Cy</b></font></td>");
tableB.Append("<td align=center><font
size=-1><b>Grp</b></font></td>");
tableB.Append("<td align=center><font
size=-1><b>Qty</b></font></td>");
tableB.Append("<td align=center><font
size=-1><b>Expected_Date</b></font></td>");
tableB.Append("</tr>");
tableS2.Append("<tr>");
tableS2.Append("<td colspan=5> <i><a
href='http://reldb.sc.ti.com/reldb/reldbmain.nsf/ShowJobDetail?OpenAgent&Relcode="
+ relcodeB + "'>" + relcodeB + " — " +
dbRecords("jobtitle").ToString() + "</a></i></td>");
tableS2.Append("</tr>");
tableS2.Append("<tr>");
tableS2.Append("<td align=center><font
size=-1><b>Test_Type</b></font></td>");
tableS2.Append("<td align=center><font
size=-1><b>Hr/Cy</b></font></td>");
tableS2.Append("<td align=center><font
size=-1><b>Grp</b></font></td>");
tableS2.Append("<td align=center><font
size=-1><b>Qty</b></font></td>");
tableS2.Append("<td align=center><font
size=-1><b>Expected_Date</b></font></td>");
tableS2.Append("</tr>");
}
tableB.Append("<tr>");
tableB.Append("<td align=center><font size=-1>" +
dbRecords("testtype").ToString() + "</font></td>");
tableB.Append("<td align=center><font size=-1>" +
dbRecords("hrcy").ToString() + "</font></td>");
tableB.Append("<td align=center><font size=-1>" +
dbRecords("grp").ToString() + "</font></td>");
tableB.Append("<td align=center><font size=-1>" +
dbRecords("qty").ToString() + "</font></td>");
tableB.Append("<td align=center><font size=-1>" + expecteddate +
"</font></td>");
tableB.Append("</tr>");
tableS2.Append("<tr>");
tableS2.Append("<td align=center><font size=-1>" +
dbRecords("testtype").ToString() + "</font></td>");
tableS2.Append("<td align=center><font size=-1>" +
dbRecords("hrcy").ToString() + "</font></td>");
tableS2.Append("<td align=center><font size=-1>" +
dbRecords("grp").ToString() + "</font></td>");
tableS2.Append("<td align=center><font size=-1>" +
dbRecords("qty").ToString() + "</font></td>");
tableS2.Append("<td align=center><font size=-1>" + expecteddate +
"</font></td>");
tableS2.Append("</tr>");
}
}
if( String.Compare(tableA.ToString(), "") != 0 ) {
tableA.Append("</table>");
tableC.Append(tableA.ToString());
tableC.Append("<br><br>");
}
if( String.Compare(tableB.ToString(), "") != 0 ) {
tableB.Append("</table>");
tableC.Append(tableB.ToString());
}
if( String.Compare(ldaputil.getLDAPValue('MAIL', pengremail, 'mail'),
"") != 0 &&
String.Compare(tableC.ToString(), "") != 0 ) {
tableC.Append("<br>NOTE: This is an auto-generated message!<br>");
sendMail(tableC.ToString(), pengremail);
}
if( String.Compare(tableS1.ToString(), "") != 0 ) {
tableS1.Append("</table>");
tableS3.Append(tableS1.ToString());
tableS3.Append("<br><br>");
}
if( String.Compare(tableS2.ToString(), "") != 0 ) {
tableS2.Append("</table>");
tableS3.Append(tableS2.ToString());
}
tableS3.Append("<br>NOTE: This is an auto-generated message!<br>");
sendMail("***Summary to Lab Manager***<br><br>" + tableS3.ToString(),
'manager@dotnet.itags.org.email.com');
dbRecords.Close();
DBConnUtil.closeQDW(dbconn);
}
}A couple of things:
Note the following in the error message:
> Please review the stack trace for more information about
> the error and where it originated in the code.
Note the following in your @.Page directive:
> <%@. Page Language="JScript" Aspcompat="true" Debug="false"
> Inherits="PETestTimeMSP" src="http://pics.10026.com/?src=source/pettmailmsp.js" %
Turing Debugging ON should give you the stack trace that will indicate the
line of code that threw the exception. From there it's simple.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
"Ben" <Ben@.discussions.microsoft.com> wrote in message
news:1AF1D1E9-E17A-40CC-BB81-94C2BD4E645F@.microsoft.com...
>I have several pages written in aspx, but sometime the aspx page return the
> following error. And it hapeen, the whole web application gives this
> error,
> that means all the aspx files get affected. Any ideas?
> Here is the error:
> Server Error in '/' 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.
> ASPX CODE:
> <%@. Page Language="JScript" Aspcompat="true" Debug="false"
> Inherits="PETestTimeMSP" src="http://pics.10026.com/?src=source/pettmailmsp.js" %>
> <%
> pettMailMSP();
> %>
> <html>
> <head>
> <title>SCReliabilityServices Emailer</title>
> </head>
> <body>
> SCReliabilityServices Emailer - Sent!
> </body>
> </html>
> SOURCE CODE:
> import System;
> import System.Data;
> import System.Data.OleDb;
> import System.Web.UI;
> import System.Web.UI.WebControls;
> import System.Web.UI.HtmlControls;
> import System.Text;
> import System.Web.Mail;
> import DBConn;
> import LDAPCOM;
> public class PETestTimeMSP extends Page {
> public function sendMail(message : String, to : String) : void {
> var Mailer : MailMessage = new MailMessage();
> Mailer.Priority = MailPriority.Normal;
> Mailer.BodyFormat = MailFormat.Html;
> Mailer.From = "manager@.email.com";
> Mailer.To = to;
> Mailer.Subject = "(MSP) DRTL PE Test Time Forecast - " + (new
> Date().getMonth()+1) + "/" + new Date().getDate() + "/" + new
> Date().getYear();
> //Mailer.Body = "<font color=blue face=Arial size=-1>Starting today,
> you
> will be receiving a daily report that should be beneficial in planning
> test
> time<br>for jobs being stressed in DRTL.<br><br>The first part of the
> report
> "Completed Stress - Pending Test" shows jobs that have completed stress
> and<br>are pending test. For jobs in this status, electrical test has not
> yet been completed - according to our database.<br>These will continue to
> stay open, until data is provided to close.<br>If you have contacted our
> lab
> on some of these jobs for closure, we are working on
> them.<br><b>Otherwise,
> please contact Jennifer McClellan.</b><br><br>The second part of the
> report
> "Forecast Readpoints for Test" is a forecast for jobs that are
> in<br>stress
> and are expected to be completed within the next 5 days.<br>The time out
> on
> the expected day is the end of the day.<br><br>Regards,<br>David
> Kaase<br>DRTL Manager</font><br><br>" + message;
> Mailer.Body = message;
> SmtpMail.SmtpServer = "smtp.mail.ti.com";
> SmtpMail.Send(Mailer);
> }
> public function pettMailMSP() : String {
> var DBConnUtil : DBConnQDW = new DBConnQDW();
> var dbconn : OleDbConnection = DBConnUtil.connectQDW();
> var sql : String = "select d.relcode, d.jobtitle, d.pengrname,
> d.pengremail, d.priority, t.testtype, t.testnum, r.grp, r.readnum, r.hrcy,
> r.qty, to_char(k.sent, 'MM/DD/YYYY') sent, to_char(k.expecteddate,
> 'MM/DD/YYYY') expecteddate, k.location from rel_device d, rel_tests t,
> rel_reads r, rel_track k where d.relcode = t.relcode and t.relcode =
> r.relcode and t.testnum = r.testnum and r.relcode = k.relcode and
> r.testnum =
> k.testnum and r.grp = k.grp and r.readnum = k.readnum and d.dbname =
> 'MSPREL'
> and t.status = 'Active' and UPPER(t.programno) like 'ENG%' and k.complete
> is
> null and k.location = 'PE Test'"
> + " union "
> + "select d.relcode, d.jobtitle, d.pengrname,
> d.pengremail, d.priority, t.testtype, t.testnum, r.grp, r.readnum, r.hrcy,
> r.qty, to_char(k.sent, 'MM/DD/YYYY') sent, to_char(k.expecteddate,
> 'MM/DD/YYYY') expecteddate, k.location from rel_device d, rel_tests t,
> rel_reads r, rel_track k where d.relcode = t.relcode and t.relcode =
> r.relcode and t.testnum = r.testnum and r.relcode = k.relcode and
> r.testnum =
> k.testnum and r.grp = k.grp and r.readnum = k.readnum and d.dbname =
> 'MSPREL'
> and t.status = 'Active' and ((t.testnum >= 0001 and t.testnum <= 0104) or
> (t.testnum >= 1000 and t.testnum <= 1615) or (t.testnum >= 2000 and
> t.testnum
> <= 2750) or (t.testnum >= 3000 and t.testnum <= 3240) or (t.testnum >=
> 3500
> and t.testnum <= 3800) or (t.testnum >= 4075 and t.testnum <= 4322) or
> (t.testnum = 9001)) and UPPER(t.programno) like 'ENG%' and k.expecteddate
> is
> not null and k.expecteddate <= sysdate+5 and k.complete is null and
> k.location like 'DRTL-%' order by 3, 5, 1, 6, 8, 12, 13";
> var dbcmd : OleDbCommand = new OleDbCommand(sql, dbconn);
> var dbRecords : OleDbDataReader = dbcmd.ExecuteReader();
> var tableA : StringBuilder = new StringBuilder();
> var tableB : StringBuilder = new StringBuilder();
> var tableC : StringBuilder = new StringBuilder();
> var tableS1 : StringBuilder = new StringBuilder();
> var tableS2 : StringBuilder = new StringBuilder();
> var tableS3 : StringBuilder = new StringBuilder();
> var pengremail : String;
> var relcodeA : String;
> var relcodeB : String;
> var expecteddate : String;
> var tempdate : Date;
> var ldaputil : LDAP = new LDAP();
> while( dbRecords.Read() ) {
> if( String.Compare(pengremail, dbRecords("pengremail")) != 0 ) {
> if( String.Compare(pengremail, null) != 0 ) {
> if( String.Compare(tableA.ToString(), "") != 0 ) {
> tableA.Append("</table>");
> tableC.Append(tableA.ToString());
> tableC.Append("<br><br>");
> }
> if( String.Compare(tableB.ToString(), "") != 0 ) {
> tableB.Append("</table>");
> tableC.Append(tableB.ToString());
> }
> if( String.Compare(ldaputil.getLDAPValue('MAIL', pengremail,
> 'mail'), "") != 0 &&
> String.Compare(tableC.ToString(), "") != 0 ) {
> tableC.Append("<br>NOTE: This is an auto-generated
> message!<br>");
> sendMail(tableC.ToString(), pengremail);
> }
> }
> pengremail = dbRecords("pengremail").ToString();
> tableA = new StringBuilder();
> tableB = new StringBuilder();
> tableC = new StringBuilder();
> }
> if( String.Compare(dbRecords("location").ToString(), 'PE Test') ==
> 0 ) {
> if( String.Compare(tableS1.ToString(), "") == 0 ) {
> tableS1.Append("<h2><font color=maroon>Completed Stress - Pending
> Test</font></h2>");
> tableS1.Append("<table width=75%>");
> }
> if( String.Compare(tableA.ToString(), "") == 0 ) {
> tableA.Append("<h2><font color=maroon>Completed Stress - Pending
> Test</font></h2>");
> tableA.Append("<table width=75%>");
> tableA.Append("<tr>");
> tableA.Append("<td colspan=7><b>PE: " +
> dbRecords("pengrname").ToString() + ":</b></td>");
> tableA.Append("</tr>");
> tableS1.Append("<tr>");
> tableS1.Append("<td colspan=7><b>PE: " +
> dbRecords("pengrname").ToString() + ":</b></td>");
> tableS1.Append("</tr>");
> }
> if( String.Compare(relcodeA, dbRecords("relcode").ToString()) !=
> 0 ) {
> relcodeA = dbRecords("relcode").ToString();
> tableA.Append("<tr>");
> tableA.Append("<td colspan=5> <i><a
> href='http://reldb.sc.ti.com/reldb/reldbmain.nsf/ShowJobDetail?OpenAgent&Relcode="
> + relcodeA + "'>" + relcodeA + " - " +
> dbRecords("jobtitle").ToString() + "</a></i></td>");
> tableA.Append("</tr>");
> tableA.Append("<tr>");
> tableA.Append("<td align=center><font
> size=-1><b>Test_Type</b></font></td>");
> tableA.Append("<td align=center><font
> size=-1><b>Hr/Cy</b></font></td>");
> tableA.Append("<td align=center><font
> size=-1><b>Grp</b></font></td>");
> tableA.Append("<td align=center><font
> size=-1><b>Qty</b></font></td>");
> tableA.Append("<td align=center><font
> size=-1><b>PE_Test</b></font></td>");
> tableA.Append("</tr>");
> tableS1.Append("<tr>");
> tableS1.Append("<td colspan=5> <i><a
> href='http://reldb.sc.ti.com/reldb/reldbmain.nsf/ShowJobDetail?OpenAgent&Relcode="
> + relcodeA + "'>" + relcodeA + " - " +
> dbRecords("jobtitle").ToString() + "</a></i></td>");
> tableS1.Append("</tr>");
> tableS1.Append("<tr>");
> tableS1.Append("<td align=center><font
> size=-1><b>Test_Type</b></font></td>");
> tableS1.Append("<td align=center><font
> size=-1><b>Hr/Cy</b></font></td>");
> tableS1.Append("<td align=center><font
> size=-1><b>Grp</b></font></td>");
> tableS1.Append("<td align=center><font
> size=-1><b>Qty</b></font></td>");
> tableS1.Append("<td align=center><font
> size=-1><b>PE_Test</b></font></td>");
> tableS1.Append("</tr>");
> }
> tableA.Append("<tr>");
> tableA.Append("<td align=center><font size=-1>" +
> dbRecords("testtype").ToString() + "</font></td>");
> tableA.Append("<td align=center><font size=-1>" +
> dbRecords("hrcy").ToString() + "</font></td>");
> tableA.Append("<td align=center><font size=-1>" +
> dbRecords("grp").ToString() + "</font></td>");
> tableA.Append("<td align=center><font size=-1>" +
> dbRecords("qty").ToString() + "</font></td>");
> tableA.Append("<td align=center><font size=-1>" +
> dbRecords("sent").ToString() + "</font></td>");
> tableA.Append("</tr>");
> tableS1.Append("<tr>");
> tableS1.Append("<td align=center><font size=-1>" +
> dbRecords("testtype").ToString() + "</font></td>");
> tableS1.Append("<td align=center><font size=-1>" +
> dbRecords("hrcy").ToString() + "</font></td>");
> tableS1.Append("<td align=center><font size=-1>" +
> dbRecords("grp").ToString() + "</font></td>");
> tableS1.Append("<td align=center><font size=-1>" +
> dbRecords("qty").ToString() + "</font></td>");
> tableS1.Append("<td align=center><font size=-1>" +
> dbRecords("sent").ToString() + "</font></td>");
> tableS1.Append("</tr>");
> }
> else {
> expecteddate = dbRecords("expecteddate").ToString();
> if( parseInt(dbRecords("testnum")) >= 1 &&
> parseInt(dbRecords("testnum")) <= 104 ) {
> sql = "select r_user from rel_reads where relcode = '" +
> dbRecords("relcode") + "' and testnum = '" + dbRecords("testnum") + "' and
> grp = '" + dbRecords("grp") + "' and readnum <= '" + dbRecords("readnum")
> +
> "' and r_user like '%Soak%'";
> var dbconnPrecon : OleDbConnection = DBConnUtil.connectQDW();
> var dbcmdPrecon : OleDbCommand = new OleDbCommand(sql,
> dbconnPrecon);
> var dbRecordsPrecon : OleDbDataReader =
> dbcmdPrecon.ExecuteReader();
> if( !dbRecordsPrecon.Read() ) {
> dbRecordsPrecon.Close();
> DBConnUtil.closeQDW(dbconnPrecon);
> continue;
> }
> else {
> tempdate = new Date(expecteddate);
> tempdate.setHours(48);
> if( tempdate > new Date().setHours(120) ) {
> dbRecordsPrecon.Close();
> DBConnUtil.closeQDW(dbconnPrecon);
> continue;
> }
> else {
> expecteddate = (new Date(tempdate).getMonth()+1) + "/" + new
> Date(tempdate).getDate() + "/" + new Date(tempdate).getYear();
> dbRecordsPrecon.Close();
> DBConnUtil.closeQDW(dbconnPrecon);
> }
> }
> }
> if( String.Compare(tableS2.ToString(), "") == 0 ) {
> tableS2.Append("<h2><font color=maroon>Forecast Readpoints for
> Test</font></h2>");
> tableS2.Append("<table width=75%>");
> }
> if( String.Compare(tableB.ToString(), "") == 0 ) {
> tableB.Append("<h2><font color=maroon>Forecast Readpoints for
> Test</font></h2>");
> tableB.Append("<table width=75%>");
> tableB.Append("<tr>");
> tableB.Append("<td colspan=7><b>PE: " +
> dbRecords("pengrname").ToString() + ":</b></td>");
> tableB.Append("</tr>");
> tableS2.Append("<tr>");
> tableS2.Append("<td colspan=7><b>PE: " +
> dbRecords("pengrname").ToString() + ":</b></td>");
> tableS2.Append("</tr>");
> }
> if( String.Compare(relcodeB, dbRecords("relcode").ToString()) !=
> 0 ) {
> relcodeB = dbRecords("relcode").ToString();
> tableB.Append("<tr>");
> tableB.Append("<td colspan=5> <i><a
> href='http://reldb.sc.ti.com/reldb/reldbmain.nsf/ShowJobDetail?OpenAgent&Relcode="
> + relcodeB + "'>" + relcodeB + " - " +
> dbRecords("jobtitle").ToString() + "</a></i></td>");
> tableB.Append("</tr>");
> tableB.Append("<tr>");
> tableB.Append("<td align=center><font
> size=-1><b>Test_Type</b></font></td>");
> tableB.Append("<td align=center><font
> size=-1><b>Hr/Cy</b></font></td>");
> tableB.Append("<td align=center><font
> size=-1><b>Grp</b></font></td>");
> tableB.Append("<td align=center><font
> size=-1><b>Qty</b></font></td>");
> tableB.Append("<td align=center><font
> size=-1><b>Expected_Date</b></font></td>");
> tableB.Append("</tr>");
> tableS2.Append("<tr>");
> tableS2.Append("<td colspan=5> <i><a
> href='http://reldb.sc.ti.com/reldb/reldbmain.nsf/ShowJobDetail?OpenAgent&Relcode="
> + relcodeB + "'>" + relcodeB + " - " +
> dbRecords("jobtitle").ToString() + "</a></i></td>");
> tableS2.Append("</tr>");
> tableS2.Append("<tr>");
> tableS2.Append("<td align=center><font
> size=-1><b>Test_Type</b></font></td>");
> tableS2.Append("<td align=center><font
> size=-1><b>Hr/Cy</b></font></td>");
> tableS2.Append("<td align=center><font
> size=-1><b>Grp</b></font></td>");
> tableS2.Append("<td align=center><font
> size=-1><b>Qty</b></font></td>");
> tableS2.Append("<td align=center><font
> size=-1><b>Expected_Date</b></font></td>");
> tableS2.Append("</tr>");
> }
> tableB.Append("<tr>");
> tableB.Append("<td align=center><font size=-1>" +
> dbRecords("testtype").ToString() + "</font></td>");
> tableB.Append("<td align=center><font size=-1>" +
> dbRecords("hrcy").ToString() + "</font></td>");
> tableB.Append("<td align=center><font size=-1>" +
> dbRecords("grp").ToString() + "</font></td>");
> tableB.Append("<td align=center><font size=-1>" +
> dbRecords("qty").ToString() + "</font></td>");
> tableB.Append("<td align=center><font size=-1>" + expecteddate +
> "</font></td>");
> tableB.Append("</tr>");
> tableS2.Append("<tr>");
> tableS2.Append("<td align=center><font size=-1>" +
> dbRecords("testtype").ToString() + "</font></td>");
> tableS2.Append("<td align=center><font size=-1>" +
> dbRecords("hrcy").ToString() + "</font></td>");
> tableS2.Append("<td align=center><font size=-1>" +
> dbRecords("grp").ToString() + "</font></td>");
> tableS2.Append("<td align=center><font size=-1>" +
> dbRecords("qty").ToString() + "</font></td>");
> tableS2.Append("<td align=center><font size=-1>" + expecteddate +
> "</font></td>");
> tableS2.Append("</tr>");
> }
> }
> if( String.Compare(tableA.ToString(), "") != 0 ) {
> tableA.Append("</table>");
> tableC.Append(tableA.ToString());
> tableC.Append("<br><br>");
> }
> if( String.Compare(tableB.ToString(), "") != 0 ) {
> tableB.Append("</table>");
> tableC.Append(tableB.ToString());
> }
> if( String.Compare(ldaputil.getLDAPValue('MAIL', pengremail, 'mail'),
> "") != 0 &&
> String.Compare(tableC.ToString(), "") != 0 ) {
> tableC.Append("<br>NOTE: This is an auto-generated message!<br>");
> sendMail(tableC.ToString(), pengremail);
> }
> if( String.Compare(tableS1.ToString(), "") != 0 ) {
> tableS1.Append("</table>");
> tableS3.Append(tableS1.ToString());
> tableS3.Append("<br><br>");
> }
> if( String.Compare(tableS2.ToString(), "") != 0 ) {
> tableS2.Append("</table>");
> tableS3.Append(tableS2.ToString());
> }
> tableS3.Append("<br>NOTE: This is an auto-generated message!<br>");
> sendMail("***Summary to Lab Manager***<br><br>" + tableS3.ToString(),
> 'manager@.email.com');
> dbRecords.Close();
> DBConnUtil.closeQDW(dbconn);
> }
> }
Kevin,
Thanks for helping out.
When I turn it on, the stack shows error during compiling and assembly
permissions issue. I cannot get the error back, because our server guy reboot
the .net service, and the pages are working again.
It happen so many times that every time it happen, all the aspx pages get
affected and the .net service return the same error for every aspx pages. And
every time I have to ask our server guy to reboot the .net service, and then
everything works again... We couldn't find out what the root cause is.
Any ideas?
Thanks,
Ben
"Kevin Spencer" wrote:
> A couple of things:
> Note the following in the error message:
> > Please review the stack trace for more information about
> > the error and where it originated in the code.
> Note the following in your @.Page directive:
> > <%@. Page Language="JScript" Aspcompat="true" Debug="false"
> > Inherits="PETestTimeMSP" src="http://pics.10026.com/?src=source/pettmailmsp.js" %>
> Turing Debugging ON should give you the stack trace that will indicate the
> line of code that threw the exception. From there it's simple.
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> ..Net Developer
> Neither a follower nor a lender be.
> "Ben" <Ben@.discussions.microsoft.com> wrote in message
> news:1AF1D1E9-E17A-40CC-BB81-94C2BD4E645F@.microsoft.com...
> >I have several pages written in aspx, but sometime the aspx page return the
> > following error. And it hapeen, the whole web application gives this
> > error,
> > that means all the aspx files get affected. Any ideas?
> > Here is the error:
> > Server Error in '/' 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.
> > ASPX CODE:
> > <%@. Page Language="JScript" Aspcompat="true" Debug="false"
> > Inherits="PETestTimeMSP" src="http://pics.10026.com/?src=source/pettmailmsp.js" %>
> > <%
> > pettMailMSP();
> > %>
> > <html>
> > <head>
> > <title>SCReliabilityServices Emailer</title>
> > </head>
> > <body>
> > SCReliabilityServices Emailer - Sent!
> > </body>
> > </html>
> > SOURCE CODE:
> > import System;
> > import System.Data;
> > import System.Data.OleDb;
> > import System.Web.UI;
> > import System.Web.UI.WebControls;
> > import System.Web.UI.HtmlControls;
> > import System.Text;
> > import System.Web.Mail;
> > import DBConn;
> > import LDAPCOM;
> > public class PETestTimeMSP extends Page {
> > public function sendMail(message : String, to : String) : void {
> > var Mailer : MailMessage = new MailMessage();
> > Mailer.Priority = MailPriority.Normal;
> > Mailer.BodyFormat = MailFormat.Html;
> > Mailer.From = "manager@.email.com";
> > Mailer.To = to;
> > Mailer.Subject = "(MSP) DRTL PE Test Time Forecast - " + (new
> > Date().getMonth()+1) + "/" + new Date().getDate() + "/" + new
> > Date().getYear();
> > //Mailer.Body = "<font color=blue face=Arial size=-1>Starting today,
> > you
> > will be receiving a daily report that should be beneficial in planning
> > test
> > time<br>for jobs being stressed in DRTL.<br><br>The first part of the
> > report
> > "Completed Stress - Pending Test" shows jobs that have completed stress
> > and<br>are pending test. For jobs in this status, electrical test has not
> > yet been completed - according to our database.<br>These will continue to
> > stay open, until data is provided to close.<br>If you have contacted our
> > lab
> > on some of these jobs for closure, we are working on
> > them.<br><b>Otherwise,
> > please contact Jennifer McClellan.</b><br><br>The second part of the
> > report
> > "Forecast Readpoints for Test" is a forecast for jobs that are
> > in<br>stress
> > and are expected to be completed within the next 5 days.<br>The time out
> > on
> > the expected day is the end of the day.<br><br>Regards,<br>David
> > Kaase<br>DRTL Manager</font><br><br>" + message;
> > Mailer.Body = message;
> > SmtpMail.SmtpServer = "smtp.mail.ti.com";
> > SmtpMail.Send(Mailer);
> > }
> > public function pettMailMSP() : String {
> > var DBConnUtil : DBConnQDW = new DBConnQDW();
> > var dbconn : OleDbConnection = DBConnUtil.connectQDW();
> > var sql : String = "select d.relcode, d.jobtitle, d.pengrname,
> > d.pengremail, d.priority, t.testtype, t.testnum, r.grp, r.readnum, r.hrcy,
> > r.qty, to_char(k.sent, 'MM/DD/YYYY') sent, to_char(k.expecteddate,
> > 'MM/DD/YYYY') expecteddate, k.location from rel_device d, rel_tests t,
> > rel_reads r, rel_track k where d.relcode = t.relcode and t.relcode =
> > r.relcode and t.testnum = r.testnum and r.relcode = k.relcode and
> > r.testnum =
> > k.testnum and r.grp = k.grp and r.readnum = k.readnum and d.dbname =
> > 'MSPREL'
> > and t.status = 'Active' and UPPER(t.programno) like 'ENG%' and k.complete
> > is
> > null and k.location = 'PE Test'"
> > + " union "
> > + "select d.relcode, d.jobtitle, d.pengrname,
> > d.pengremail, d.priority, t.testtype, t.testnum, r.grp, r.readnum, r.hrcy,
> > r.qty, to_char(k.sent, 'MM/DD/YYYY') sent, to_char(k.expecteddate,
> > 'MM/DD/YYYY') expecteddate, k.location from rel_device d, rel_tests t,
> > rel_reads r, rel_track k where d.relcode = t.relcode and t.relcode =
> > r.relcode and t.testnum = r.testnum and r.relcode = k.relcode and
> > r.testnum =
> > k.testnum and r.grp = k.grp and r.readnum = k.readnum and d.dbname =
> > 'MSPREL'
> > and t.status = 'Active' and ((t.testnum >= 0001 and t.testnum <= 0104) or
> > (t.testnum >= 1000 and t.testnum <= 1615) or (t.testnum >= 2000 and
> > t.testnum
> > <= 2750) or (t.testnum >= 3000 and t.testnum <= 3240) or (t.testnum >=
> > 3500
> > and t.testnum <= 3800) or (t.testnum >= 4075 and t.testnum <= 4322) or
> > (t.testnum = 9001)) and UPPER(t.programno) like 'ENG%' and k.expecteddate
> > is
> > not null and k.expecteddate <= sysdate+5 and k.complete is null and
> > k.location like 'DRTL-%' order by 3, 5, 1, 6, 8, 12, 13";
> > var dbcmd : OleDbCommand = new OleDbCommand(sql, dbconn);
> > var dbRecords : OleDbDataReader = dbcmd.ExecuteReader();
> > var tableA : StringBuilder = new StringBuilder();
> > var tableB : StringBuilder = new StringBuilder();
> > var tableC : StringBuilder = new StringBuilder();
> > var tableS1 : StringBuilder = new StringBuilder();
> > var tableS2 : StringBuilder = new StringBuilder();
> > var tableS3 : StringBuilder = new StringBuilder();
> > var pengremail : String;
> > var relcodeA : String;
> > var relcodeB : String;
> > var expecteddate : String;
> > var tempdate : Date;
> > var ldaputil : LDAP = new LDAP();
> > while( dbRecords.Read() ) {
> > if( String.Compare(pengremail, dbRecords("pengremail")) != 0 ) {
> > if( String.Compare(pengremail, null) != 0 ) {
> > if( String.Compare(tableA.ToString(), "") != 0 ) {
> > tableA.Append("</table>");
> > tableC.Append(tableA.ToString());
> > tableC.Append("<br><br>");
> > }
> > if( String.Compare(tableB.ToString(), "") != 0 ) {
> > tableB.Append("</table>");
> > tableC.Append(tableB.ToString());
> > }
> > if( String.Compare(ldaputil.getLDAPValue('MAIL', pengremail,
> > 'mail'), "") != 0 &&
> > String.Compare(tableC.ToString(), "") != 0 ) {
> > tableC.Append("<br>NOTE: This is an auto-generated
> > message!<br>");
> > sendMail(tableC.ToString(), pengremail);
> > }
> > }
> > pengremail = dbRecords("pengremail").ToString();
> > tableA = new StringBuilder();
> > tableB = new StringBuilder();
> > tableC = new StringBuilder();
> > }
> > if( String.Compare(dbRecords("location").ToString(), 'PE Test') ==
> > 0 ) {
> > if( String.Compare(tableS1.ToString(), "") == 0 ) {
> > tableS1.Append("<h2><font color=maroon>Completed Stress - Pending
> > Test</font></h2>");
> > tableS1.Append("<table width=75%>");
> > }
> > if( String.Compare(tableA.ToString(), "") == 0 ) {
> > tableA.Append("<h2><font color=maroon>Completed Stress - Pending
> > Test</font></h2>");
> > tableA.Append("<table width=75%>");
> > tableA.Append("<tr>");
> > tableA.Append("<td colspan=7><b>PE: " +
> > dbRecords("pengrname").ToString() + ":</b></td>");
> > tableA.Append("</tr>");
> > tableS1.Append("<tr>");
> > tableS1.Append("<td colspan=7><b>PE: " +
> > dbRecords("pengrname").ToString() + ":</b></td>");
> > tableS1.Append("</tr>");
> > }
> > if( String.Compare(relcodeA, dbRecords("relcode").ToString()) !=
> > 0 ) {
> > relcodeA = dbRecords("relcode").ToString();
> > tableA.Append("<tr>");
> > tableA.Append("<td colspan=5> <i><a
> > href='http://reldb.sc.ti.com/reldb/reldbmain.nsf/ShowJobDetail?OpenAgent&Relcode="
> > + relcodeA + "'>" + relcodeA + " - " +
> > dbRecords("jobtitle").ToString() + "</a></i></td>");
> > tableA.Append("</tr>");
> > tableA.Append("<tr>");
> > tableA.Append("<td align=center><font
> > size=-1><b>Test_Type</b></font></td>");
> > tableA.Append("<td align=center><font
> > size=-1><b>Hr/Cy</b></font></td>");
> > tableA.Append("<td align=center><font
> > size=-1><b>Grp</b></font></td>");
> > tableA.Append("<td align=center><font
> > size=-1><b>Qty</b></font></td>");
> > tableA.Append("<td align=center><font
> > size=-1><b>PE_Test</b></font></td>");
> > tableA.Append("</tr>");
> > tableS1.Append("<tr>");
> > tableS1.Append("<td colspan=5> <i><a
> > href='http://reldb.sc.ti.com/reldb/reldbmain.nsf/ShowJobDetail?OpenAgent&Relcode="
> > + relcodeA + "'>" + relcodeA + " - " +
> > dbRecords("jobtitle").ToString() + "</a></i></td>");
> > tableS1.Append("</tr>");
> > tableS1.Append("<tr>");
> > tableS1.Append("<td align=center><font
> > size=-1><b>Test_Type</b></font></td>");
> > tableS1.Append("<td align=center><font
> > size=-1><b>Hr/Cy</b></font></td>");
> > tableS1.Append("<td align=center><font
> > size=-1><b>Grp</b></font></td>");
> > tableS1.Append("<td align=center><font
> > size=-1><b>Qty</b></font></td>");
> > tableS1.Append("<td align=center><font
> > size=-1><b>PE_Test</b></font></td>");
> > tableS1.Append("</tr>");
> > }
> > tableA.Append("<tr>");
> > tableA.Append("<td align=center><font size=-1>" +
> > dbRecords("testtype").ToString() + "</font></td>");
> > tableA.Append("<td align=center><font size=-1>" +
> > dbRecords("hrcy").ToString() + "</font></td>");
> > tableA.Append("<td align=center><font size=-1>" +
> > dbRecords("grp").ToString() + "</font></td>");
> > tableA.Append("<td align=center><font size=-1>" +
> > dbRecords("qty").ToString() + "</font></td>");
> > tableA.Append("<td align=center><font size=-1>" +
> > dbRecords("sent").ToString() + "</font></td>");
> > tableA.Append("</tr>");
> > tableS1.Append("<tr>");
> > tableS1.Append("<td align=center><font size=-1>" +
> > dbRecords("testtype").ToString() + "</font></td>");
> > tableS1.Append("<td align=center><font size=-1>" +
> > dbRecords("hrcy").ToString() + "</font></td>");
> > tableS1.Append("<td align=center><font size=-1>" +
> > dbRecords("grp").ToString() + "</font></td>");
> > tableS1.Append("<td align=center><font size=-1>" +
> > dbRecords("qty").ToString() + "</font></td>");
> > tableS1.Append("<td align=center><font size=-1>" +
> > dbRecords("sent").ToString() + "</font></td>");
> > tableS1.Append("</tr>");
> > }
> > else {
> > expecteddate = dbRecords("expecteddate").ToString();
> > if( parseInt(dbRecords("testnum")) >= 1 &&
> > parseInt(dbRecords("testnum")) <= 104 ) {
> > sql = "select r_user from rel_reads where relcode = '" +
> > dbRecords("relcode") + "' and testnum = '" + dbRecords("testnum") + "' and
> > grp = '" + dbRecords("grp") + "' and readnum <= '" + dbRecords("readnum")
> > +
> > "' and r_user like '%Soak%'";
> > var dbconnPrecon : OleDbConnection = DBConnUtil.connectQDW();
> > var dbcmdPrecon : OleDbCommand = new OleDbCommand(sql,
> > dbconnPrecon);
> > var dbRecordsPrecon : OleDbDataReader =
> > dbcmdPrecon.ExecuteReader();
> > if( !dbRecordsPrecon.Read() ) {
> > dbRecordsPrecon.Close();
> > DBConnUtil.closeQDW(dbconnPrecon);
> > continue;
> > }
> > else {
> > tempdate = new Date(expecteddate);
> > tempdate.setHours(48);
> > if( tempdate > new Date().setHours(120) ) {
> > dbRecordsPrecon.Close();
> > DBConnUtil.closeQDW(dbconnPrecon);
> > continue;
> > }
> > else {
> > expecteddate = (new Date(tempdate).getMonth()+1) + "/" + new
> > Date(tempdate).getDate() + "/" + new Date(tempdate).getYear();
> > dbRecordsPrecon.Close();
> > DBConnUtil.closeQDW(dbconnPrecon);
> > }
> > }
> > }
> > if( String.Compare(tableS2.ToString(), "") == 0 ) {
> > tableS2.Append("<h2><font color=maroon>Forecast Readpoints for
> > Test</font></h2>");
> > tableS2.Append("<table width=75%>");
> > }
> > if( String.Compare(tableB.ToString(), "") == 0 ) {
> > tableB.Append("<h2><font color=maroon>Forecast Readpoints for
> > Test</font></h2>");
> > tableB.Append("<table width=75%>");
> > tableB.Append("<tr>");
> > tableB.Append("<td colspan=7><b>PE: " +
> > dbRecords("pengrname").ToString() + ":</b></td>");
> > tableB.Append("</tr>");
> > tableS2.Append("<tr>");
> > tableS2.Append("<td colspan=7><b>PE: " +
> > dbRecords("pengrname").ToString() + ":</b></td>");
> > tableS2.Append("</tr>");
> > }
> > if( String.Compare(relcodeB, dbRecords("relcode").ToString()) !=
> > 0 ) {
> > relcodeB = dbRecords("relcode").ToString();
> > tableB.Append("<tr>");
> > tableB.Append("<td colspan=5> <i><a
> > href='http://reldb.sc.ti.com/reldb/reldbmain.nsf/ShowJobDetail?OpenAgent&Relcode="
> > + relcodeB + "'>" + relcodeB + " - " +
> > dbRecords("jobtitle").ToString() + "</a></i></td>");
> > tableB.Append("</tr>");
> > tableB.Append("<tr>");
> > tableB.Append("<td align=center><font
> > size=-1><b>Test_Type</b></font></td>");
> > tableB.Append("<td align=center><font
> > size=-1><b>Hr/Cy</b></font></td>");
> > tableB.Append("<td align=center><font
> > size=-1><b>Grp</b></font></td>");
> > tableB.Append("<td align=center><font
> > size=-1><b>Qty</b></font></td>");
> > tableB.Append("<td align=center><font
> > size=-1><b>Expected_Date</b></font></td>");
> > tableB.Append("</tr>");
> > tableS2.Append("<tr>");
> > tableS2.Append("<td colspan=5> <i><a
> > href='http://reldb.sc.ti.com/reldb/reldbmain.nsf/ShowJobDetail?OpenAgent&Relcode="
> > + relcodeB + "'>" + relcodeB + " - " +
> > dbRecords("jobtitle").ToString() + "</a></i></td>");
> > tableS2.Append("</tr>");
> > tableS2.Append("<tr>");
> > tableS2.Append("<td align=center><font
> > size=-1><b>Test_Type</b></font></td>");
> > tableS2.Append("<td align=center><font
> > size=-1><b>Hr/Cy</b></font></td>");
> > tableS2.Append("<td align=center><font
> > size=-1><b>Grp</b></font></td>");
> > tableS2.Append("<td align=center><font
> > size=-1><b>Qty</b></font></td>");
> > tableS2.Append("<td align=center><font
> > size=-1><b>Expected_Date</b></font></td>");
> > tableS2.Append("</tr>");
> > }
> > tableB.Append("<tr>");
> > tableB.Append("<td align=center><font size=-1>" +
> > dbRecords("testtype").ToString() + "</font></td>");
> > tableB.Append("<td align=center><font size=-1>" +
> > dbRecords("hrcy").ToString() + "</font></td>");
> > tableB.Append("<td align=center><font size=-1>" +
> > dbRecords("grp").ToString() + "</font></td>");
> > tableB.Append("<td align=center><font size=-1>" +
> > dbRecords("qty").ToString() + "</font></td>");
> > tableB.Append("<td align=center><font size=-1>" + expecteddate +
> > "</font></td>");
> > tableB.Append("</tr>");
> > tableS2.Append("<tr>");
> > tableS2.Append("<td align=center><font size=-1>" +
> > dbRecords("testtype").ToString() + "</font></td>");
> > tableS2.Append("<td align=center><font size=-1>" +
> > dbRecords("hrcy").ToString() + "</font></td>");
> > tableS2.Append("<td align=center><font size=-1>" +
> > dbRecords("grp").ToString() + "</font></td>");
> > tableS2.Append("<td align=center><font size=-1>" +
> > dbRecords("qty").ToString() + "</font></td>");
> > tableS2.Append("<td align=center><font size=-1>" + expecteddate +
> > "</font></td>");
> > tableS2.Append("</tr>");
> > }
> > }
> > if( String.Compare(tableA.ToString(), "") != 0 ) {
> > tableA.Append("</table>");
> > tableC.Append(tableA.ToString());
> > tableC.Append("<br><br>");
> > }
> > if( String.Compare(tableB.ToString(), "") != 0 ) {
> > tableB.Append("</table>");
> > tableC.Append(tableB.ToString());
> > }
> > if( String.Compare(ldaputil.getLDAPValue('MAIL', pengremail, 'mail'),
> > "") != 0 &&
> > String.Compare(tableC.ToString(), "") != 0 ) {
> > tableC.Append("<br>NOTE: This is an auto-generated message!<br>");
> > sendMail(tableC.ToString(), pengremail);
> > }
> > if( String.Compare(tableS1.ToString(), "") != 0 ) {
> > tableS1.Append("</table>");
> > tableS3.Append(tableS1.ToString());
> > tableS3.Append("<br><br>");
> > }
> > if( String.Compare(tableS2.ToString(), "") != 0 ) {
> > tableS2.Append("</table>");
> > tableS3.Append(tableS2.ToString());
> > }
> > tableS3.Append("<br>NOTE: This is an auto-generated message!<br>");
> > sendMail("***Summary to Lab Manager***<br><br>" + tableS3.ToString(),
> > 'manager@.email.com');
> > dbRecords.Close();
> > DBConnUtil.closeQDW(dbconn);
> > }
> > }
>