473,385 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Verify fields of a class

Dear All,
I have a class

Public class ClassA
Public Age as integer = 0
Public Name as String = ""
Public Salary as integer = 0
End class

I create the Object of this class
Dim oBj as new ClassA

I have a function that takes some parameters one being the field name

Function FillDetails ( byval ..., byref fieldname as Object,...)

When the application programmer calls this function
FillDetails(...,oBj.Age,...)

My function wants to compare if the pass field exists in the class
Object defined in the function

Dim fldList() As System.Reflection.FieldInfo =
myObj.GetType.GetFields()
Count =0
While Count < _fldList.Length - 1
If Field Is _fldList(Count).GetValue(myObj) Then
strField = _fldList(Count).Name
Exit While
Else
'do nothing
End If
Count = Count + 1
End While

This function works well if pass a class having fields that are
userdefined...but for a simple class like mentioned above it fails...

Could someone please help?

TALIA
Many Regards
Sunil
Nov 22 '05 #1
0 976

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sunil Menon | last post by:
Dear All, I have a class Public class ClassA Public Age as integer = 0 Public Name as String = "" Public Salary as integer = 0 End class I create the Object of this class
0
by: Support | last post by:
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"> <head>...
0
by: Wells Fargo | last post by:
<html dir=3D"ltr"> <head> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dwindows= -1252"> <title>New Page 1</title> </head> <body>
0
by: Sunil Menon | last post by:
Dear All, I have a class Public class ClassA { Public int Age = 0; Public string Name = ""; Public int Salary= 0; } I create the Object of this class
2
by: Wayne Wengert | last post by:
I want to write a Windows application to go through all the email addresses in an SQL Server table and to report which ones are invalid. From Googling and perusing NGs it is my understanding that...
0
by: service | last post by:
This is a multi-part message in MIME format --siNt1NhCoyB3mEPydjXJyOTcg=_X6kQe0H0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable - This mail is a HTML mail. Not all...
0
by: CHC | last post by:
Hi, I would like to verify the authenticity of a X509 digital certificate. I'm using Crypt::X509 to create a certificate object and can extract the data fields. But, I can't find a way to verify...
43
by: Xancatal | last post by:
Hey everybody. I need help on this one. I need to verify that a number entered by a user is not either a negative number (-100.00), or an alphabet (a, b, c, X, Y) as well as other number other than...
3
by: jpr | last post by:
Hello, I have a form on which I have a cmdbutton to copy a couple of fields into another table (MASTER) using the SSN on the active form as criteria. In the active form (based on a tables...
482
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if this is more of a coldfusion problem or a javscript problem. So if i asked my question in the wrong section let me know an all move it to the correct place. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.