Hi,
I am using MapXtreme 8.1 in a Visual Studio .Net 2015 program.
If the temp table is open but not in a map, the update runs propertly.
But if the temp table is in the map (visible or not is the same), the update crash
The error is:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt. Thank you!
This is the code...
Private Sub btnActualizar_Click(sender As Object, e As EventArgs) Handles btnActualizar.Click
Dim oCatalog As Catalog = Session.Current.Catalog
Dim li_q_filas As Integer
Try
Dim oMITable_LineasTemp As Table = oCatalog.GetTable("LineasTemp")
'------------------------------------------------------------
' Update Style
'------------------------------------------------------------
Dim oMIStyle As New MapInfo.Styles.SimpleLineStyle(New LineWidth(3, MapInfo.Styles.LineWidthUnit.Pixel), 4, Color.Black)
Dim oMIConnection As New MapInfo.Data.MIConnection
oMIConnection.Open()
Dim oMICommand As MapInfo.Data.MICommand = oMIConnection.CreateCommand
oMICommand.CommandText = "Update LineasTemp Set MI_Style = @style Where Tipo_Aislacion = 'Desnudo'"
oMICommand.Parameters.Add("@style", oMIStyle)
li_q_filas = oMICommand.ExecuteNonQuery()
MsgBox(li_q_filas)
'------------------------------------------------------------
' Close connections
'------------------------------------------------------------
oMICommand.Dispose()
oMIConnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub------------------------------
Alejandro Hernandez
Information Technology & Services
ITS SA (GBD)
Buenos Aires
------------------------------