I am splitting the label file path into an array as shown below. When I run the program, I get the error indicated at bottom of this page, Can anyone tell me how to avoid making this error.

Thanks


Dim arrFilename() As String = Split(lblFilePath.Text, "\")
arrFilename.Reverse(arrFilename)

Error 1 Access of shared member, constant member,
num member or nested type through an instance; qualifying expression will not be evaluated.
C:\vb9.net\read_write_images\frmMain.vb 525 9
VB.NET How-To Read-Write Images to Database

am splitting the label file path into an array as shown below. When I run the program, I get the error indicated at bottom of this page, Can anyone tell me how to avoid making this error.

Thanks


Dim arrFilename() As String = Split(lblFilePath.Text, "\")
arrFilename.Reverse(arrFilename)

Error 1 Access of shared member, constant member,
num member or nested type through an instance; qualifying expression will not be evaluated.
C:\vb9.net\read_write_images\frmMain.vb 525 9
VB.NET How-To Read-Write Images to Database

Edited 6 Years Ago by __avd: Double threads

>Access of shared member, constant member,num member or nested type through an instance; qualifying expression will not be evaluated.

It's warning not an error.


Method Reverse is a static/shared method so it can be invoked with its ClassName. However in VB.NET you can invoke shared and instance method using an instance variable.

Suggested by GeekByChoiCe

Array.Reverse(arrFilename) 'Use this approach

'or

arrFilename.Reverse(arrFilename) 'Not recommend

Hi

Dim arrFilename() As String = Split(lblFilePath.Text, "\")
For i As Integer = 0 To arrFilename.Length - 1
Dim query as String="your Insertion Query Valuse('arrFilename(i)')"
Next

Kourosh Nikzad

Edited 6 Years Ago by __avd: Added [code] tags. For easy readability, always wrap programming code within posts in [code] (code blocks).

This article has been dead for over six months. Start a new discussion instead.