0

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 by __avd: Double threads

5
Contributors
4
Replies
6
Views
6 Years
Discussion Span
Last Post by kouroshnik
0

>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
0

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 by __avd: Added [code] tags. For easy readability, always wrap programming code within posts in [code] (code blocks).

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.