Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old July 18th, 2007, 01:32 PM
Authorized User
 
Join Date: Jul 2007
Location: Austin, Texas, USA.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #12 (permalink)  
Old July 18th, 2007, 01:45 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Can you post the code for the private fields and public properties of your class? I may have an idea.....

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.
Reply With Quote
  #13 (permalink)  
Old July 18th, 2007, 02:11 PM
Authorized User
 
Join Date: Jul 2007
Location: Austin, Texas, USA.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #14 (permalink)  
Old July 18th, 2007, 02:16 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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.
Reply With Quote
  #15 (permalink)  
Old July 18th, 2007, 02:42 PM
Authorized User
 
Join Date: Jul 2007
Location: Austin, Texas, USA.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #16 (permalink)  
Old July 18th, 2007, 02:53 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Well, you can't have my patients, but other than that, you're more than welcome.... ;)

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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
repeating data ph0neman Classic ASP Basics 5 January 18th, 2008 12:34 PM
Data Binding - Editing GridView Row Data desk_star BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 7 December 30th, 2007 11:07 AM
repeater repeating in horizontal (data in 2 colums gbianchi ASP.NET 2.0 Professional 0 April 11th, 2007 11:08 AM
Get data From GridView whitewolf5 ASP.NET 2.0 Basics 0 September 1st, 2006 08:19 AM
Dynamic data in Gridview lukemack ASP.NET 2.0 Basics 8 May 26th, 2006 03:37 PM



All times are GMT -4. The time now is 04:39 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.