Results 1 to 5 of 5

Thread: Dealing with Dynamic Databases/Datasets ** Resolved **

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2003
    Posts
    153

    Dealing with Dynamic Databases/Datasets ** Resolved **

    I have set up an application to use a dynamic database in where it only knows 1 table and 2 primary keys exist (When the database is much larger than this). It's loading the database and values correctly, however, I need to allow another external component to communicate with the dataset.

    I would like to use Properties as they are the most intuitive feature to use. However, you are unable to pass parameters to a property. (You can pass 1 to a get, but the set already has it's parameter taken by the value being passed to it)

    So properties won't work here.

    One option is having 2 seperate functions. GetValue, SetValue. Which are easy enough to implement but I view as being messy.

    Are there any other options?
    Last edited by Carnifex; Sep 14th, 2003 at 08:46 PM.

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    If your functions in a class obj , Did you try using Consturctors if this would help you ?

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2003
    Posts
    153
    Hmm. Don't think this will help too much, might have to resort to using functions due to the complexity of finding data based on passed values.

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    A property can have parameters on both get/set:
    VB Code:
    1. Public Class PropTest
    2.  
    3.     Private _Names() As String = {"Ed", "Cookie", "Mike"}
    4.  
    5.     Public Property Name(ByVal index As Integer) As String
    6.         Get
    7.             Return _Names(index)
    8.         End Get
    9.         Set(ByVal Value As String)
    10.             _Names(index) = Value
    11.         End Set
    12.     End Property
    13.  
    14. End Class
    15.  
    16. 'syntax
    17.         Dim pt As New PropTest
    18.         pt.Name(1)="YourNameHere"
    19.         MessageBox.Show(pt.Name(1))

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Aug 2003
    Posts
    153
    Thanks Edneeis, worked a charm, didn't even think about the parthensis beside the property name. duh.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width