S
Sheldon Glickler
I am getting error messages that I do not understand:
1. Unused local variable 'filePath'
2. Access of shared member, constant member, enum member or nested type
through an instance; qualifying expression will not be evaluated. (this
was at the "files =" line)
What is happening?
Shelly
Here is the code:
Function CreateDataSource() As ICollection
Dim dt As DataTable
Dim dr As DataRow
Dim filePath As Directory
Dim directory As String
Dim files As String()
Dim File As String
directory = "C:\apcourier\aspx\photos\1012"
files = filePath.GetFiles(directory, "*")
'create a DataTable
dt = New DataTable
dt.Columns.Add(New DataColumn("TheFile", GetType(String)))
'Put data in the rows
For Each File In files
dr = dt.NewRow()
dr(0) = "C:\apcourier\aspx\photos\1012\" & File
dt.Rows.Add(dr)
Next
'return a DataView to the DataTable
CreateDataSource = New DataView(dt)
End Function
1. Unused local variable 'filePath'
2. Access of shared member, constant member, enum member or nested type
through an instance; qualifying expression will not be evaluated. (this
was at the "files =" line)
What is happening?
Shelly
Here is the code:
Function CreateDataSource() As ICollection
Dim dt As DataTable
Dim dr As DataRow
Dim filePath As Directory
Dim directory As String
Dim files As String()
Dim File As String
directory = "C:\apcourier\aspx\photos\1012"
files = filePath.GetFiles(directory, "*")
'create a DataTable
dt = New DataTable
dt.Columns.Add(New DataColumn("TheFile", GetType(String)))
'Put data in the rows
For Each File In files
dr = dt.NewRow()
dr(0) = "C:\apcourier\aspx\photos\1012\" & File
dt.Rows.Add(dr)
Next
'return a DataView to the DataTable
CreateDataSource = New DataView(dt)
End Function