I have a class called StoredProcedure Info that has four get/set
properties: ID, Name, Text and IsChecked. I have created a generic
list of this class, populated it and now want to make sure certain
values exist in it.
=============== =============== =====
protected List<StoredProc edureInfostored ProcedureList = new
List<StoredProc edureInfo>();
=============== =============== =====
In a simpler generic list -- for example, List<int-- I would do this
by calling List<int>.Conta ins() or List<int>.Index Of() . But how would
I do this in a more complex, custom class like mine? I'm attaching my
class declaration code below, in case it helps... any help or advince
would be appreciated!
=============== =============== =====
public class StoredProcedure Info {
private int databaseObjectI d = 0;
private string storedProcedure Name = null;
private string storedProcedure CreateStatement = null;
private bool isChecked = false;
// Constructors
public StoredProcedure Info(int DatabaseObjectI d, string
StoredProcedure Name, string CreateProcedure Text, bool IsChecked) {
this.StoredProc edureID = DatabaseObjectI d;
this.StoredProc edureName = StoredProcedure Name;
this.StoredProc edureText = CreateProcedure Text;
this.IsStoredPr ocedureChecked = IsChecked;
}
public StoredProcedure Info(int DatabaseObjectI d, string
StoredProcedure Name, string CreateProcedure Text) :
this(DatabaseOb jectId, StoredProcedure Name, CreateProcedure Text, false)
{ }
public StoredProcedure Info() { }
// Properties
public int StoredProcedure ID {
get { return databaseObjectI d; }
private set { databaseObjectI d = value; }
}
public string StoredProcedure Name {
get { return storedProcedure Name; }
private set { storedProcedure Name = value; }
}
public string StoredProcedure Text {
get { return storedProcedure CreateStatement ; }
private set { storedProcedure CreateStatement = value; }
}
public bool IsStoredProcedu reChecked {
get { return isChecked; }
private set { isChecked = value; }
}
}
=============== =============== =====
-= Tek Boy =- 0 896 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Kakarot |
last post by:
I'm gona be very honest here, I suck at programming, *especially* at
C++. It's funny because I actually like the idea of programming ...
normally what I like I'm atleast decent at. But C++ is a different
story.
Linked lists have been giving me a headache. I can barely manage to
create a single/doubly linked list, it's just that when it gets to
merge sorting or searching (by reading shit data from text files), I
lose track.
|
by: Carl Gilbert |
last post by:
Hi
I am trying to use a custom attribute that takes in an array or list of
custom objects. Ths custom object has a text property and a type property.
I have a custom attribute which has a constructor that takes a class as
follows:
=======================================================
Public Class MyAttribute
Inherits System.Attribute
|
by: Greg Buchholz |
last post by:
/*
I've been experimenting with some generic/polytypic programs, and
I've stumbled on to a problem that I can't quite figure out. In the
program below, I'm trying to define a generic version of "transform"
which works not only on lists, but lists of list, lists of lists of
lists, etc. I'm calling it "fmap" and it passes around actual lists
instead of iterators (for now). In order to get it to work, I thought
I'd have one templated...
|
by: Wiktor Zychla [C# MVP] |
last post by:
We do have generic classes, methods and delegates. My question is: what
reason prevents us from having generic properties and indexers?
// impossible
public List<T> GetList<T>
{
get
{
...
}
|
by: Pieter |
last post by:
Hi,
I'm using NHibernate 1.2 (CR1), and I'm using a custom list (inherited from
BindingList(Of T) ) for all my lists.
The NHibernate documentation told me that I had to implement
IUserCollectionType to my custom list, which I did. But I still get an error
when trying to read the object: "
{"Unable to cast object of type
'NHibernate.Collection.Generic.PersistentGenericBag`1' to
| |
by: Suds |
last post by:
Hi,
I'm having an issue with invoking a Generic method that takes Generic Arguments.
My method signature is
public void GenericMethodWithGenericArguments<E, V>(List<EtheFirstList, List<VtheSecondList);
I pass the name of the method, the arguments for the "GenericMethodWithGenericArguments" to another method, which is supposed to invoke this method using the Invoke method in the MethodInfo class.
My process of invocation is as follows
|
by: Max Odendahl |
last post by:
Hi,
my own declared class has a stl::list as a member variable. I now need
access to those from the outside. Is a custom iterator for my class the best
solution for this and how to do this?
I would like to sort the list according to different criteria before, so I
would like to offer different iterators, which then sort first based on the
type of iterator constructed.
Any code sample or link would be nice.
|
by: jappenzeller |
last post by:
I've got a coding standard question for generic lists and .NET 2.0.
I have created some custom strongly typed lists like, MyClassList:List<MyClass>.
We did this because we wanted to reuse some helper methods that are at the list level, for instance, maybe we need to get some type of Average of MyClass's in the list so I have a method Average in the MyClassList class.
One of the problems with this is if I use something like Find or FindAll...
|
by: Linda Liu[MSFT] |
last post by:
Hi George,
I have downloaded your sample solution and built it on my machine. I got a
compilation error indicating that the type of "CustomResources" doesn't
exist in the following xaml code:
<Expander Style="{DynamicResource {ComponentResourceKey
TypeInTargetAssembly={x:Type res:CustomResources},
ResourceId=CustomExpanderStyle1}}" >
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |