Click here to Skip to main content
15,899,679 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHow to FTP a file not existing on server through vb.net Pin
nav_duggal23-Feb-09 20:03
nav_duggal23-Feb-09 20:03 
AnswerRe: How to FTP a file not existing on server through vb.net Pin
JR21223-Feb-09 20:52
JR21223-Feb-09 20:52 
GeneralRe: How to FTP a file not existing on server through vb.net Pin
nav_duggal23-Feb-09 20:58
nav_duggal23-Feb-09 20:58 
AnswerRe: How to FTP a file not existing on server through vb.net Pin
kadaoui el mehdi23-Feb-09 21:00
kadaoui el mehdi23-Feb-09 21:00 
QuestionPrinting xml Pin
Stephen Lintott23-Feb-09 20:01
Stephen Lintott23-Feb-09 20:01 
Questionhow to bind checkedlistbox with dataset in vb.net (window application) Pin
Jagz W23-Feb-09 19:06
professionalJagz W23-Feb-09 19:06 
AnswerRe: how to bind checkedlistbox with dataset in vb.net (window application) Pin
Dave Kreskowiak24-Feb-09 3:51
mveDave Kreskowiak24-Feb-09 3:51 
QuestionUsing Reflection to on a Subclass as a Property Pin
nickbequick23-Feb-09 11:52
nickbequick23-Feb-09 11:52 
I'm trying to use a class in place of a property and need help with getting the Reflection correct.

Here is a very simple example of what I'm doing:

Public Class Contact

    Dim _contactID As zyp_ContactID

    Public Sub New()

    End Sub

    Public Property ContactID() As Guid
        Get
            Return _contactID.value
        End Get
        Set(ByVal value As Guid)
            _contactID.value = value
        End Set
    End Property


    Public Class zyp_ContactID

        Protected Friend Sub New()

        End Sub

        Dim _contactID As Guid

        Public Property value() As Guid
            Get
                Return _contactID
            End Get
            Set(ByVal value As Guid)
                _contactID = value
            End Set
        End Property


    End Class

End Class
br mode="hold" />
In my previous work I've always just had public properties and used Refelection to hydrate from the database.  This allowed me to have a Services class that handled all the hydration through a DatabaseHelper class.  There was only one class for each business object that handled hydrating and only one class for the whole program which interfaced to the database.  Switching to a different database or even to XML or Web Services was just a one-class change (at least as far as the application code was concerned).

I've run into some real limitations with Properties and creating subclasses appears to be the solution.

I previously used code from Chris Rock, <a href="http://www.rocksthoughts.com/blog/archive/2008/04/24/creating-a-datarow-to-customer-object-mapper.aspx">http://www.rocksthoughts.com/blog/archive/2008/04/24/creating-a-datarow-to-customer-object-mapper.aspx</a>, to map from a database to a custom business object.  So long as I used the attribute it has worked perfectly.

So now I need help with the following:

For each property in the class

1. Is the property a class ?
2. If so, does the class have a property of "value" ?
3. If so, can we write to the property "value" ?
4. If so, write to the property "value".

Any hints are greatly appreciated...I'm stuck on this and hate the idea of not being able to use a generic mapper class.

As an alternative, is there a way to pass a reference to a function to a sub so that the sub can call the function referenced.  This is a backup option if I can't get the generic mapper class to work. 

AnswerRe: Using Reflection to on a Subclass as a Property Pin
Dave Kreskowiak24-Feb-09 3:50
mveDave Kreskowiak24-Feb-09 3:50 
GeneralRe: Using Reflection to on a Subclass as a Property Pin
nickbequick24-Feb-09 4:01
nickbequick24-Feb-09 4:01 
GeneralRe: Using Reflection to on a Subclass as a Property Pin
Dave Kreskowiak24-Feb-09 6:17
mveDave Kreskowiak24-Feb-09 6:17 
QuestionProblems getting httpWebRequest to work Pin
rfrank535623-Feb-09 8:22
rfrank535623-Feb-09 8:22 
AnswerRe: Problems getting httpWebRequest to work Pin
Dave Kreskowiak24-Feb-09 3:43
mveDave Kreskowiak24-Feb-09 3:43 
GeneralRe: Problems getting httpWebRequest to work [modified] Pin
rfrank535624-Feb-09 10:21
rfrank535624-Feb-09 10:21 
Question$$$ $$$ NEED VB BASIC HELP - WEB DATA EXTRACTION - NEED CODE !!! $$$ $$$ Pin
pcfacile23-Feb-09 7:49
pcfacile23-Feb-09 7:49 
AnswerRe: $$$ $$$ NEED VB BASIC HELP - WEB DATA EXTRACTION - NEED CODE !!! $$$ $$$ Pin
0x3c023-Feb-09 8:00
0x3c023-Feb-09 8:00 
AnswerRe: $$$ $$$ NEED VB BASIC HELP - WEB DATA EXTRACTION - NEED CODE !!! $$$ $$$ Pin
Mycroft Holmes23-Feb-09 15:57
professionalMycroft Holmes23-Feb-09 15:57 
QuestionHow to place the text at cursor position in vb.net textbox Pin
dilipmca0423-Feb-09 3:39
dilipmca0423-Feb-09 3:39 
AnswerRe: How to place the text at cursor position in vb.net textbox Pin
Dave Kreskowiak23-Feb-09 4:28
mveDave Kreskowiak23-Feb-09 4:28 
GeneralNew features in VB 10 Pin
Kevin McFarlane23-Feb-09 2:23
Kevin McFarlane23-Feb-09 2:23 
QuestionHow save a playlist in vb.net Pin
akosidandan23-Feb-09 2:03
akosidandan23-Feb-09 2:03 
AnswerRe: How save a playlist in vb.net Pin
Dave Kreskowiak23-Feb-09 4:27
mveDave Kreskowiak23-Feb-09 4:27 
QuestionEXCEL-How to trigger a function with the keyboard enter key Pin
Anoop Brijmohun23-Feb-09 2:01
Anoop Brijmohun23-Feb-09 2:01 
AnswerRe: EXCEL-How to trigger a function with the keyboard enter key Pin
Dave Kreskowiak23-Feb-09 4:26
mveDave Kreskowiak23-Feb-09 4:26 
Questioncould some one help me how save ms access database using vb 2008 Pin
akosidandan23-Feb-09 1:55
akosidandan23-Feb-09 1:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.