|
-
Sep 11th, 2003, 01:42 AM
#1
Thread Starter
Addicted Member
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.
-
Sep 11th, 2003, 08:15 AM
#2
Sleep mode
If your functions in a class obj , Did you try using Consturctors if this would help you ?
-
Sep 11th, 2003, 06:56 PM
#3
Thread Starter
Addicted Member
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.
-
Sep 12th, 2003, 09:52 AM
#4
A property can have parameters on both get/set:
VB Code:
Public Class PropTest
Private _Names() As String = {"Ed", "Cookie", "Mike"}
Public Property Name(ByVal index As Integer) As String
Get
Return _Names(index)
End Get
Set(ByVal Value As String)
_Names(index) = Value
End Set
End Property
End Class
'syntax
Dim pt As New PropTest
pt.Name(1)="YourNameHere"
MessageBox.Show(pt.Name(1))
-
Sep 14th, 2003, 08:47 PM
#5
Thread Starter
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|