I open a table, create a new row and then search the table for that row, but can't find it. Why?
Using tblAttachments As Table = gdb.OpenDataset(Of Table)("Attachments")
Using rb As RowBuffer = tblAttachments.CreateRowBuffer()
With rb
.Item("ROWGUID") = ATTACH_GUID
.Item("Filename") = Path.GetFileName(Filename)
.Item("ATTACHMENT_BLOB") = buffer
.Item("ATTACH_DATE") = File.GetCreationTime(Filename).ToShortDateString()
End With
Dim row As Row = tblAttachments.CreateRow(rb)
row.Store()
row.Dispose()
row = Nothing
End Using
' Try a querydef here to see if we can see the record we just added
Dim qf As New QueryFilter
qf.WhereClause = "ROWGUID = '" + ATTACH_GUID + "'"
Using rc As RowCursor = tblAttachments.Search(qf)
While (rc.MoveNext())
Debug.Print("Hello world")
End While
End Using
End Using
ArcSDE requires the left and right curly braces in a Guid. Are they present in the where clause?
qf.WhereClause = "ROWGUID = '" + ATTACH_GUID + "'"
Just thinking out loud here...
Does the row eventually appear in the Attachments table?
Could row.Store() take a while, and the cursor creates, searches, and finishes before the row is fully in place?
Just a curiosity question - can you try Using the Row as you do with the Table and RowCursor instead of calling row.Dispose() directly?
I just tried "Using" and it didn't help.