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

Recommended Answers

All 4 Replies

do Array.Reverse(arrFilename)

>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

I'm not sure what you are trying to do but try changing it to

Array.Reverse(arrFilename)

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.