Showing posts with label written. Show all posts
Showing posts with label written. Show all posts

Saturday, March 24, 2012

System.Net.Webclient screen scraping: how to gracefully handle 403 (and other) errors?

I've written a very small ASP.NET page to scrape thousands of pages of
content based on database IDs. It loops through a dataset to get the IDs. It
worked well in testing but now I am getting an annoying 403 error that
causes the script to abort halfway through my download.

I am wondering if there is a way in ASP.NET to have my code ignore 403
errors and other network errors, catch the error, and iterate to the next ID
in the dataset rather than aborting the whole job.

My code appears below. Thank you in advance.

-KF

string strConnection;

strConnection = ConfigurationSettings.AppSettings["connwhatever"];

SqlConnection conn = new SqlConnection(strConnection);

string query = // [my query];

SqlDataAdapter a = new SqlDataAdapter(query, conn);

DataSet s = new DataSet();

a.Fill(s);

int counter = 0;

foreach (DataRow dr in s.Tables[0].Rows)

{

counter++;

System.Net.WebClient wc = new WebClient();

string strData =
wc.DownloadString("http://whatever.org/article.asp?articleid=" +
dr[0].ToString());

FileStream fstream = new FileStream(@dotnet.itags.org."c:\whateverpath\" + dr[0].ToString() +
".htm", FileMode.Create, FileAccess.Write);

StreamWriter stream = new StreamWriter(fstream);

stream.Write(strData);

stream.Close();

fstream.Close();please read chapter on try/catch

-- bruce (sqlwork.com)

kenfine@.nospam.nospam wrote:

Quote:

Originally Posted by

I've written a very small ASP.NET page to scrape thousands of pages of
content based on database IDs. It loops through a dataset to get the IDs. It
worked well in testing but now I am getting an annoying 403 error that
causes the script to abort halfway through my download.
>
I am wondering if there is a way in ASP.NET to have my code ignore 403
errors and other network errors, catch the error, and iterate to the next ID
in the dataset rather than aborting the whole job.
>
My code appears below. Thank you in advance.
>
-KF
>
string strConnection;
>
strConnection = ConfigurationSettings.AppSettings["connwhatever"];
>
SqlConnection conn = new SqlConnection(strConnection);
>
string query = // [my query];
>
SqlDataAdapter a = new SqlDataAdapter(query, conn);
>
DataSet s = new DataSet();
>
a.Fill(s);
>
int counter = 0;
>
foreach (DataRow dr in s.Tables[0].Rows)
>
{
>
counter++;
>
System.Net.WebClient wc = new WebClient();
>
string strData =
wc.DownloadString("http://whatever.org/article.asp?articleid=" +
dr[0].ToString());
>
FileStream fstream = new FileStream(@."c:\whateverpath\" + dr[0].ToString() +
".htm", FileMode.Create, FileAccess.Write);
>
StreamWriter stream = new StreamWriter(fstream);
>
stream.Write(strData);
>
stream.Close();
>
fstream.Close();
>
>
>
>


Understand try/catch generally. What event(s) should I be trying to catch?

Thank you,
-KF

"bruce barker" <nospam@.nospam.comwrote in message
news:%23F79bSINHHA.3288@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

please read chapter on try/catch
>
-- bruce (sqlwork.com)
>
kenfine@.nospam.nospam wrote:

Quote:

Originally Posted by

>I've written a very small ASP.NET page to scrape thousands of pages of
>content based on database IDs. It loops through a dataset to get the IDs.
>It worked well in testing but now I am getting an annoying 403 error that
>causes the script to abort halfway through my download.
>>
>I am wondering if there is a way in ASP.NET to have my code ignore 403
>errors and other network errors, catch the error, and iterate to the next
>ID in the dataset rather than aborting the whole job.
>>
>My code appears below. Thank you in advance.
>>
>-KF
>>
>string strConnection;
>>
>strConnection = ConfigurationSettings.AppSettings["connwhatever"];
>>
>SqlConnection conn = new SqlConnection(strConnection);
>>
>string query = // [my query];
>>
>SqlDataAdapter a = new SqlDataAdapter(query, conn);
>>
>DataSet s = new DataSet();
>>
>a.Fill(s);
>>
>int counter = 0;
>>
>foreach (DataRow dr in s.Tables[0].Rows)
>>
>{
>>
>counter++;
>>
>System.Net.WebClient wc = new WebClient();
>>
>string strData =
>wc.DownloadString("http://whatever.org/article.asp?articleid=" +
>dr[0].ToString());
>>
>FileStream fstream = new FileStream(@."c:\whateverpath\" +
>dr[0].ToString() + ".htm", FileMode.Create, FileAccess.Write);
>>
>StreamWriter stream = new StreamWriter(fstream);
>>
>stream.Write(strData);
>>
>stream.Close();
>>
>fstream.Close();
>>
>>
>>


Hello KF,

Based on your description, you're using the webclient class to request many
web pages programmatically in ASP.NET page code. However, since some page
may raise some exception, your client loop code in ASP.NET page break,
correct?

As for the 403 error, it is normally caused by the security authorization
checking at server-side fails. I'm not sure whether there is any other
particular scenario here, however, if what you want is simply captuer and
ignore such error and continue the loop, you can just add a try catch block
around your webclient class's downloadXXX method call and if any exception
captured you can simply ignore it and skip the current loop. e.g.

=======================
foreach (DataRow dr in s.Tables[0].Rows)

{

counter++;

System.Net.WebClient wc = new WebClient();

try
{

string strData =
wc.DownloadString("http://whatever.org/article.asp?articleid=" +
dr[0].ToString());

}catch(Exception ex)
{
//ignore and continue the loop
}

...........................

}
=========================

Does this work for your scenario?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscript...rt/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
For webclient or HttpWebRequest, it normally will throw a
System.Net.WebException, however, any exception can be handled by the super
class "Exception". So you can use either

try
{
}catch(Exception)
{

}

or

try
{
}catch(WebException)
{

}

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.
You can specify error documents for specific error-codes.

In your web.config, add the following entries in <system.websection:

<customErrors>
<error statusCode="403" redirect="403.aspx"/>
</customErrors>

Note that generally, 403 would be given by the web server and not be the
ASP.Net engine. At times, when the authentication fails, 403 may be returned
by an IHttpModule - like the authentication modules (NTML, Kerberos, Digest
etc).

--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujini-labs.com
http://eduzine.edujinionline.com
-------------

<kenfine@.nospam.nospamwrote in message
news:%23SginPGNHHA.4916@.TK2MSFTNGP06.phx.gbl...

Quote:

Originally Posted by

I've written a very small ASP.NET page to scrape thousands of pages of
content based on database IDs. It loops through a dataset to get the IDs.
It worked well in testing but now I am getting an annoying 403 error that
causes the script to abort halfway through my download.
>
I am wondering if there is a way in ASP.NET to have my code ignore 403
errors and other network errors, catch the error, and iterate to the next
ID in the dataset rather than aborting the whole job.
>
My code appears below. Thank you in advance.


This worked great for my scenario. Thanks very much to everyone for the
timely assistance.

-KF

"Steven Cheng[MSFT]" <stcheng@.online.microsoft.comwrote in message
news:FYKH6FJNHHA.2024@.TK2MSFTNGHUB02.phx.gbl...

Quote:

Originally Posted by

Hello KF,
>
Based on your description, you're using the webclient class to request
many
web pages programmatically in ASP.NET page code. However, since some page
may raise some exception, your client loop code in ASP.NET page break,
correct?
>
As for the 403 error, it is normally caused by the security authorization
checking at server-side fails. I'm not sure whether there is any other
particular scenario here, however, if what you want is simply captuer and
ignore such error and continue the loop, you can just add a try catch
block
around your webclient class's downloadXXX method call and if any exception
captured you can simply ignore it and skip the current loop. e.g.
>
=======================
foreach (DataRow dr in s.Tables[0].Rows)
>
{
>
counter++;
>
System.Net.WebClient wc = new WebClient();
>
try
{
>
string strData =
wc.DownloadString("http://whatever.org/article.asp?articleid=" +
dr[0].ToString());
>
}catch(Exception ex)
{
//ignore and continue the loop
}
>
...........................
>
}
=========================
>
Does this work for your scenario?
>
Sincerely,
>
Steven Cheng
>
Microsoft MSDN Online Support Lead
>
>
>
==================================================
>
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications.
>
>
>
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscript...rt/default.aspx.
>
==================================================
>
>
>
This posting is provided "AS IS" with no warranties, and confers no
rights.
>

System.Nullreference Exception

i have written the following code to call a method in a class like

in the aspx.cs page
List<string> surls = new List<string>();

Cweb.GetMainUrls(document,ref surls);
Response.Write(surls);

in the Cweb Class page the coding is like

public static void GetMainUrls(Htmldocument doc,ref List<string> urls)
{
//Some functionalities
}

i get the following error when i run the application like

System.NullReference Exception
object reference not set to an instance

so because of this error my method is not getting called from the class and hence no result

can anyone help me out in finding like why my method was not called

i google through several sites and found that
this may be due to the fact that the "surls" are null and hence the method was not called
i dont follow these sequence

so anybody plz help me on this regard
thanks
Rama

System.NullReference Exception means you have referred an object, while this object is not instantialized.
object reference not set to an instance"this may be due to the fact that the "surls" are null and hence the method was not called " --> i think it's probablely because of that. So, set a break point there and debug. then see what the value of urls is. (well, response.write maybe a easier way to do that)

Hope my suggestion helps :)

Thursday, March 22, 2012

System.NullReferenceException: Object reference not set to an inst

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 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

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:

<%@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);
> > }
> > }
>