how to get dynamic control array position or its index position?



how to get dynamic control array position or its index position?..

Answer / Diwakar Kumar

In VB.NET, you can get the index position of an element in a dynamic control array using the Array.IndexOf method. Here's an example:

```vbnet
Dim myArray As Object() = {1, 2, 3, 4, 5}
Dim index As Integer = myArray.GetUpperBound(0) ' Get the upper bound of the array
For i As Integer = 0 To index
If myArray(i) = 3 Then ' Check if the element is 3
Console.WriteLine("The position of 3 is " & i) ' Print the position
End If
Next
```
In this example, the position of `3` in the array is printed.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More VB.NET Interview Questions

What does assert() method do In VB.NET

1 Answers   MCN Solutions,


How to achieve Polymorphism in VB.Net?

1 Answers  


What is the exact defination of object?

1 Answers  


What is static member?

1 Answers  


What are the difference between structure and class?

1 Answers  


How do you validate Date by using which validation Control?

4 Answers   HCL, iQuest,


How to create Crystal Report in vb.net with coding

1 Answers   A3Logics, Ascent, TCS,


hi dear ! thank u for replying to my question regarding adding third party software in vb.net .My next question is that i haven created Data base in SQL server 2000 for Library and has connected that with VB and VB.net separately but it only works on single computer and when i takes my software to another computer on same Network it does not work . Can any body help me what i do to solve. Regards!

1 Answers  


How to store jpeg / gif / bmp image in database and how to retrieve them? The most stressful condition is database is distributed and stored images can be retrive from any computer in network and any one can store images from other computer!! plss help its urgent.......RAHUL RATHOD

3 Answers  


What is the strong name in .net assembly?

1 Answers  


List the types of authentication?

1 Answers  


What are the differences between server-side and client-side code?

1 Answers  


Categories