automatic properties in vs2005???

  • Thread starter Thread starter Biranchi Narayan Panda
  • Start date Start date
B

Biranchi Narayan Panda

is it possible in .net framework 2.0 to create a class that can server the
purpose of List<> ?

eg.

A class Job that has empno, ename etc. I want to get data from database in
form of List<Job> and bind it to gridView. The problem is that I'm using
VS2005 and I'll not be able to upgrade.


So, what modification do I need to make to the following class to server the
above purpose--


//automatic property of .net framework 3.0
public class Job
{
public int empno{get; set}
public string ename{get; set}
}


I want to make a class in .NET framework 2.0 that will help me to create
object of Job and List<Job>, bind with gridview and etc.

please assist.
 
If you asking about Generics, .NET 2.0 (and VS 2005) supports it, so you
don't need to upgrade.

Not sure what your question is relating to automatic properties.

Can you be more clear? If you simply make a job class, then you can have a
List<Job> with no additional code.

-Scott
 
using System.Collections.Generic;



That is a VS2005-available (Framework version 2.0 or with add-ins,
Framework version 3.0).

I've went with this slight habit now

public class JobCollection : System.Collections.Generic.List<Job>
{ /* Yep, that's it! */ }


So I have future-proofed myself if I need to encapsulate any methods on the
JobCollection.

//automatic property of .net framework 3.0

That is a C# 3.0 feature.....not a "Framework" feature.
http://www.lmgtfy.com/?q=c#+3.0+automatic+properties




Now, if you're really bored then you can start down this rabbit trail:
http://www.danielmoth.com/Blog/2007/05/using-c-30-from-net-20.html
I have not went down that rabbit trail..........so you're on your own there.
 
Back
Top