 |
| ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

July 18th, 2007, 01:32 PM
|
|
Authorized User
|
|
Join Date: Jul 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Imar,
I've added more breakpoints and continue to test. I am noticing that the 'actv_dt' in my tempList is being overlayed. The zero index record in the tempList should have the '05/01/2007' date, but whenever a record with a new date comes along, all of the records in the tempList get that new date. Strangely, no other fields are overlayed. What could cause something like that? It's probably something real simple, but this is turning into a real head scratcher!
Richard Lelle
Austin, Tx USA
|
|

July 18th, 2007, 02:11 PM
|
|
Authorized User
|
|
Join Date: Jul 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I take it you mean the BO class?
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using GVCAPS.DAL;
using GVCAPS.BLL;
namespace GVCAPS.BO
{
public class ParticipationActivity
{
#region Private Vaiables
private int prtptActvId = -1;
private static DateTime actvDt = DateTime.MinValue;
private int actvId = -1;
private string actvTypeCd = string.Empty;
private string empId = string.Empty;
private DateTime logUpdtDttm = actvDt;
private int logUpdtrId = -1;
private string actvDscr = string.Empty;
private ParticipationActivityList participationActivities = new ParticipationActivityList();
#endregion
#region Public Properties
public DateTime actv_dt
{
get
{
//throw new System.NotImplementedException();
return actvDt;
}
set
{
actvDt = value;
}
}
public int actv_id
{
get
{
//throw new System.NotImplementedException();
return actvId;
}
set
{
actvId = value;
}
}
public string actv_type_cd
{
get
{
//throw new System.NotImplementedException();
return actvTypeCd;
}
set
{
actvTypeCd = value;
}
}
public string emp_id
{
get
{
//throw new System.NotImplementedException();
return empId;
}
set
{
empId = value;
}
}
public DateTime log_updt_dttm
{
get
{
//throw new System.NotImplementedException();
return logUpdtDttm;
}
set
{
logUpdtDttm = value;
}
}
public int log_updtr_id
{
get
{
//throw new System.NotImplementedException();
return logUpdtrId;
}
set
{
logUpdtrId = value;
}
}
public int prtpt_actv_id
{
get
{
//throw new System.NotImplementedException();
return prtptActvId;
}
set
{
prtptActvId = value;
}
}
public string actv_dscr
{
get
{
//throw new System.NotImplementedException();
return actvDscr;
}
set
{
actvDscr = value;
}
}
#endregion
}
}
Richard Lelle
Austin, Tx USA
|
|

July 18th, 2007, 02:16 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Yes, exactly what I meant, and *exactly* what I was expecting. Take a look at this:
private static DateTime actvDt = DateTime.MinValue;
You declare the field actvDt as static. In contrast to instance fields, static fields apply to the entire class, and not to an instance of that class. Change a static field in one instance, and all the other instances reflect that change.
Simply remove the static keyword from the field declaration and you're good to go.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
|
|

July 18th, 2007, 02:42 PM
|
|
Authorized User
|
|
Join Date: Jul 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
THAT WAS IT!!!! I don't know what posessed me into declaring that variable as static. Now I can FINALLY move on and finish developing my portion of this app.
Imar, thank you very much for your help and patients.
Richard Lelle
Austin, Tx USA
|
|
 |