A
Azkaban
Hi I succeded to add a DataColumn to DataSet but now I've one big problem.
The value of this column would be a personal function result, I try a lot of
time but the result is always empty.
Why?
There's a method to do this thing?
This is the code
cols = ImageDataSet.Tables("Immagini").Columns
myCol = cols.Add()
With myCol
.DataType = System.Type.GetType("System.String")
.ColumnName = "IPTC"
.Expression = ReadIPTCProperty("Path")
.ReadOnly = True
.Unique = False
End With
And this is the function:
Private Function ReadIPTCProperty(ByVal Path As String) As String
Dim gr As New Graphic
gr.ReadIPTC = True
gr.SetFile(Path)
Dim ip As Graphic.IPTCItem
For Each ip In gr.IPTC
If UCase(ip.Name) = "CAPTION" Then
ReadIPTCProperty = "'" & ip.Text & "'"
End If
Next
End Function
Thank you.
The value of this column would be a personal function result, I try a lot of
time but the result is always empty.
Why?
There's a method to do this thing?
This is the code
cols = ImageDataSet.Tables("Immagini").Columns
myCol = cols.Add()
With myCol
.DataType = System.Type.GetType("System.String")
.ColumnName = "IPTC"
.Expression = ReadIPTCProperty("Path")
.ReadOnly = True
.Unique = False
End With
And this is the function:
Private Function ReadIPTCProperty(ByVal Path As String) As String
Dim gr As New Graphic
gr.ReadIPTC = True
gr.SetFile(Path)
Dim ip As Graphic.IPTCItem
For Each ip In gr.IPTC
If UCase(ip.Name) = "CAPTION" Then
ReadIPTCProperty = "'" & ip.Text & "'"
End If
Next
End Function
Thank you.