Create A Generic For All The Classes Having Common Data?

Aug 2, 2010

I need to create a generic for all the classes having common data.I am having a Test.xsd dataset.In that dataset I am having 3 Table Adapter.

pgaddressTableAdapter1
pgaddressTableAdapter2
pgaddressTableAdapter3

Code is here. You can see all these classes having same methods. I want to create a generic class for these class.

[Code]...

View 2 Replies


ADVERTISEMENT

Create A Generic Shared Class That Can Operate On Predefined Classes

Jan 27, 2010

I have an interface that i have declared some of the basic internal functions, subs, properties, etc. This interface is then implemented into 3 pre-defined classes. These classes are end-use classes so they dont get derived or inherited elsewhere. I am trying to create a generic shared class that can operate on each of these 3 predefined classes and potentially more as long as they implement the interface.

[Code]...

View 10 Replies

Is There A Concept Of "Generic Structure" Similar To Generic Collections, Generic Classes

Dec 16, 2009

We have migrated our Vb6 application to VB.NET using a third party tool. Now we are in a process of Refactoring and introducing object oriented concepts in the application.

In VB6, we were using structures in many places. As a part of introducing object oriented programming,

1. is it a good idea of changing all Structures to Classes? or Is there a concept of "Generic Structure" similar to Generic collections, Generic classes?

2. Can some one guide me any source containing guide lines or best practices for applications that are migrated to VB.NET from VB6 and implementing object oriented programmaing.

View 3 Replies

Include Common Definitions To Multiple Classes?

Jul 26, 2011

I want to be able to incorporate some constant definitions and enum types in multiple classes of mine.Something akin to including a header file in C++. How do I do this best in VB.NET? I'm having a hard time because the only way I can see to do it is to inherit a class with the definitions in it but there is no multiple inheritance in vb.net so I am having some issues with that.

View 6 Replies

Moving Modules/classes/forms To A Common Folder?

Nov 23, 2009

I have two projects

a.sln and b.sln they have their own classes, modules and forms.

As I work on solution 'A' I devise a class and save it in solution A's folder. As the class develops, I now find a need for it in solution B.

How can I move it from solution A's folder to my Common folder then link it into solution A and B.

Currently I am doing this manually, Moving then linking to it. Is there a way to do this withing the IDE

View 14 Replies

.net - Apply Common Codes In Inherited BaseEdit For Inheriting Classes - In Order To Build A Read Only User?

Feb 20, 2012

In businesslayer, there is a inherited Class Called BaseEdit which contains contractor and base properties. There are about 30 CustomEdit (inheriting classes), all of them has methods "Load","Save" and "Delete". The require for this existing system is to add a readonly user. Possible solutions considering the cost of works:

1) Modify the BaseEdit so all CustomEdit can stay the same. The system will check 'user role' in session by using httpcontext then to accept or reject the user's action.

[Code]...

View 1 Replies

.net - Generic Classes (T) - Specifying From A Range Of Type?

Jul 28, 2010

This is the code I'm trying to develop:

Public Structure Statistic(Of t)
Dim maxStat As t
Dim curStat As t

[Code].....

View 2 Replies

Generic Constraints That Allow Type To Be 2 Different Classes?

Mar 21, 2012

I have a generic function in VB.Net. I also have two classes called A and B. Is it possible to allow the generic constraints on my function to allow the Type to be either class A or B? Class A and B do not share any base classes except for object.

View 1 Replies

Deep Copy Generic List Of Classes

Aug 15, 2006

If I have a generic.list(of ClassA), is there a simple way to create a deep copy of this list that will not affect the original copy? It seems to work if I have a generic list of Structures, but for some reason the copy constructor for lists of classes only copies pointers to the elements (or maybe a pointer to the whole list?). I would move to structures if it were not for the fact that I can't find a way to edit the members in the structs in the list. eg:list(0).a = 5 'Does not workIs there some way to get around this without declaring an instance of that structure, like this:dim str as StructA = list(0)str.a = 5I'd

View 2 Replies

Make Base Interface For Generic Classes?

May 25, 2010

I'm trying to create a base interface for a class of mine that uses generics. However, I cannot figure out how to declare a property of the interface when its type won't be defined until the class is initialized.

To clarify, consider List(of T), which according to msdn, implements IList (among other things). Note that IList is not the same as its generic counterpart IList(Of T). So that mean any List(of T) can be converted to IList, which simply returns an object for its items. That's what I want to do with MyClass(of T), be able to cast it as IMyClass regardless of what T is.

But when I try such as:

Interface IMyClass
Prop A as Object
Class MyClass(of T) Implements IMyClass
Prop A as T Implements IMyClass.A

I get a signature error for the last line, even though object is broader than T. What am I doing wrong, or how exactly did Microsoft manage to make List(of T) implement IList?

View 9 Replies

WinForms - How To Create Common Toolstrip

Jun 13, 2011

Can I use tools commonly for all the winforms? How to create common toolstrip?
For example : I have one toolstrip.it has one delete button.
All winform has one datagrid and data comes from differs tables.
Now I want to remove the data from the any datagrid all winforms.

View 1 Replies

Generics - Create A Common Database Class In .NET?

Jun 12, 2009

We have 3 databases providers we use to connect to our databases: DB2, MS SQL, and Interbase. I would like to create a single generic database wrapper class that can be used to talk to all three just by passing in the correct connection string, username, password, and the provider desired.

I don't want to have to add references and import all three providers in the database class. Is this possible?I have done this before in Java using the Class.forName() function.

View 4 Replies

Get The Data 'less Common As Possible' From A Collection?

May 15, 2011

Starting from a table like this:

| Code | Year |
---------------
| A01 | 2001 |
| A01 | 2002 |
| B01 | 2002 |
| C01 | 2003 |

I have to arrive to this:

| Code | Year |
---------------
| A01 | 2001 |
| B01 | 2002 |
| C01 | 2003 |

I have to group the first column (Code) and from the second (Year) I have to get the data 'less common as possible' compared to all the other records. I try to explain this with the example: for the code 'A01' I have 2 years: '2001' and '2002'. I have to take '2001' because it's the one that not recurs in the other records. In the case that there aren't available values 'Year' that not recurs in the other records, it's good to take whatever value.

The data are in the form of array in memory and to interact with them I'm useng some LINQ queries.

View 4 Replies

Use A Table Input For Common Repeating Data?

Apr 19, 2011

I am coding a Student Management System using VB.NET and Access DOn the Form for Teacher Bio-Data, I want to use a table in which I can place Teacher Qualifications in a tabular format. In other words, say, the teacher had Primary, Secondary and Tertiary education. I want to put a header as Qualifications, Year and Grades. Is there any such tool in Visual Studio that I can use?

View 9 Replies

[2008] Multiple Results - Data Entries In My Database That Have A Common Field

Jan 31, 2009

I have data entries in my database that have a common field. For example:

account_id type user_id

1 new 1
2 old 3
3 new 1
4 old 1

I am using a query like this(mysql): SELECT account_id, type, user_id FROM table WHERE user_id = 1

This is just all theoretical. The problem that I am having with this is it is only returning the first result in this case account_id 1. How can I get it to find all the results with the user_id 1 because in the way I am thinking that it is failing is that it is finding only the first result and then ending?

View 1 Replies

Create A Generic Property?

Dec 8, 2009

I'd like to do something like this:

Private _myCollection As IList(Of T)
Public Property MyProperty(Of T)() as IList(Of T)
Get

[Code]....

Basically, I want to have a collection of items that may be of any type. Then, I'll be able to do something like this:

Dim myPropertyValue as <the type of some value>
if (MyProperty.Contains(<some value>))
myPropertyValue = CType(MyProperty(<some value>), <the type of some value>)

How can I do this? Or is there a better way than using a generic type?

View 1 Replies

VS 2008 Create Windows Service Using Windows Form Common Control?

May 3, 2012

It is possible to create windows service using windows form control in vb.net. give me the url or links. The windows forms control such as, Timer control, list-box, notify-icon control etc.

View 1 Replies

C# - Create A Generic Method In A Class?

Apr 28, 2010

I am really trying to follow the DRY principle. I have a sub that looks like this?

Private Sub DoSupplyModel
OutputLine("ITEM SUMMARIES")
Dim ItemSumms As New SupplyModel.ItemSummaries(_currentSupplyModel, _excelRows)
ItemSumms.FillRows()

[Code]...

View 4 Replies

Create A Function That Uses A Generic Structure?

Apr 1, 2009

I am attempting to create a generic function that the students in my introductory VB .NET course can use to search a single dimension array of a structure.[code]...

My question is: Is there a way to reference the individual structure fields in the array from inside the function? I was trying to make it generic so that the student could simply pass their array into the function - their structure may be named differently than mine and the field names may be different.

I suspect there are other ways to deal with this situation, but I was trying to keep it to just a simple single-dimension array of a structure. I don't think it is possible to do what I want, but I wondered what others thought.

View 5 Replies

Create A Generic Dictionary That Implements IXmlSerializable ?

Apr 19, 2010

I was trying to create a generic Dictionary that implements IXmlSerializable (credit to Charles Feduke).

Here is my trial:

Sub Main()
Dim z As New SerializableDictionary(Of String, String)
z.Add("asdf", "asd")

[Code].....

View 2 Replies

How To Create A Generic Constructor - BaseClass.FromXml

Mar 19, 2010

How can I create a generic constructor? (ie. BaseClass.FromXml(<param>). I'm not sure how to describe this but I'm trying to create a base class that contains a shared (factory) function called FromXml. I want this function to instantiate an object of the proper type and then fill it via an XmlDocument.

For example, let's say I have something like this: [Code]

I'd like to be able to do something like this:

Dim myObject As CustomObject = CustomObject.FromXml(source)

Is this possible?

View 2 Replies

Create A List Of Mulitple Classes?

Nov 5, 2011

I am working on an assignment that requires several classes, two of which inherit a base class.[code]...

Is it possible to create a list that would contain both the Checking balance and the Savings balance since they are separate classes?

View 10 Replies

How To Create Form Visual Classes

Jul 15, 2011

i am a visual foxpro programmer, and in that language we can make not only user controls like textbox, combobox, grid,etc.But form classes in visual way, doing drag and drop a form class. How can i make the same thing in vb.net?

View 4 Replies

Create A Generic ListView User Control That Can Be Used Over And Over Again In Different Projects?

Jul 9, 2009

I'm trying to create a generic ListView user control that can be used over and over again in different projects. I've got all the basics done but I want to be able to act on click events in the from not the user control. In other words if someone right clicks on the listview, for example, I want the form to know it and be able to act on it.

View 8 Replies

Create A List Of A Generic Type That Will Be Passed As A Parameter?

Feb 14, 2011

say I have two POCOs I'm using in EF code first

Public class C1
property F1 as integer
End Class
Public class C2
property F2 as String
End Class

I want to have a function that will create a list either of C1 or C2, to be used in some generic operation, such that

[Code]...

View 1 Replies

Create Classes In Windows Service Project?

Nov 12, 2009

i create a class library or use already created class library in my windows service project. I have 1 dll file then how can i use that file in my project.?Logic is my Greatest Asset !

View 1 Replies

Create Multiple Classes Of Different Names That Use That Class?

Mar 6, 2009

Okay, say I have a class named "ChannelList", and it raises an event named "FoundChannel"

But what I'M wanting to do is create multiple classes of different names that use that class, but I want to have all of the "FoundChannel" events be handled under one single sub routine?

View 15 Replies

Create Separate Classes For The Timesheets And Invoices?

Oct 19, 2010

I have a class called FileInfo. It has properties for stuff like FileNumber, Vessel, OpenedDate etc.

Now for a file I need to have Timesheets and Invoices.

My question is, do I create seperate classes for the Timesheets and Invoices?

View 5 Replies

Possible To Create Interfaces And Classes In Design Mode?

Nov 16, 2009

Sometime ago I used to create all my class structures in vision before I wrote them. That however didn't last. I found it easier to just make little drawings with pencil and piece of paper. And I still do to this day. In code usually those drawings manifest themselves as interfaces which then are implemented by different classes. I do all this in code. And I was just wondering if there is any tools available in Visual Studio for VB.NET that would allow to create interfaces and implement them in classes (which a lot of times means just adding variables to class that will hold data passed with interface attributes) from design mode(kinda like using Visio only after you finish you don't have to write out code).

View 3 Replies

Create A Class To Deal With Records From The Classes Table?

Dec 5, 2010

Create a class to deal with records from the Classes table, much like the Student class we created in Lecture #17 handles Students records. The name of the class should be Ualb_Class (note we cannot use Class, as it is a reserved word in VBA). All of the fields should have corresponding properties. There are few considerations:

The class (course) code, department code, and course number are set at Initialize, so there is only a Get property method for those

The property for Meeting Day only accepts one of the values defined in the table. You can decide whether to accept an integer value or a string value of the days represented.

You are also to code the Initialize method, much like we coded the Initialize method for the Student class in Lecture #17. In the Initialize method, you will use the InputBox function to obtain the department code and course number. use a different InputBox for each value, so you don't have to mess with separating the single text value returned from that function. The Course Code will be obtained by using a function that has already been created, called GetNewCourseID. It has no parameters.

TABLE: Classes
Field Name
Data type

[Code]....

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved