Hi Alejandro,
The column (MI_Style) cannot be updated independently. The Style and Geometry columns must be updated at the same time. (Please refer to MapXtreme_DeveloperGuide.pdf).
Therefore following code (similar to your scenario) will throw exception:
...
oMICommand.CommandText = "Update " + oMITable_LineasTemp.Alias + " Set MI_Style = @style Where Name IN ('Greg')"
oMICommand.Parameters.Add("@style", oMIStyle)
li_q_filas = oMICommand.ExecuteNonQuery
MsgBox(li_q_filas)
But, following code will work:
...
Dim ptFeatureGeometry As FeatureGeometry = New Point(MapControl1.Map.GetDisplayCoordSys(), New DPoint(-119, 35))
oMICommand.CommandText = "Update " + oMITable_LineasTemp.Alias + " Set obj = @geometry, MI_Style = @style Where Name IN ('Greg')"
oMICommand.Parameters.Add("@geometry", ptFeatureGeometry)
oMICommand.Parameters.Add("@style", oMIStyle)
li_q_filas = oMICommand.ExecuteNonQuery
MsgBox(li_q_filas)
I verified that above scenarios are true for both cases, whether layer is visible or not. Thus you need to update Style and Geometry columns simultaneously.
But, as you said "If the table is not display the update runs properly", I have not been able to observe the same. Please provide reproducible steps for the same or let us know if the problem with above steps is resolved?
------------------------------
Arvind Kumar
Knowledge Community Shared Account
Shelton CT
------------------------------
Original Message:
Sent: 01-08-2020 07:25
From: Alejandro Hernandez
Subject: Alter tool tip text for existing buttons
Hi Bob
Yes, I am traing to update a Temp table that is displayed in a map.
In Mapxtreme 8.1.
If the table is not display the update runs propertly
Where is the problem??
Thank you!
Original Message------
Hi Alejandro,
Are you trying to update a table that is currently displayed in a Map in MapInfo Pro?
Or is this a MapXtreme.net question?
-Bob
ps. Are you missing parenthesis on li_q_filas = oMICommand.ExecuteNonQuery()
------------------------------
Bob Fortin
Software Architect and Distinguished Engineer
MapInfo Pro Development Team
------------------------------