Can't Add new rows to remote MS SQL Table with key and autoincrement colum

Use FindAsync and SetValues ​​to update entities.


Make sure IdAvion is set to auto-increment.


Consider encapsulating DB access in a service for better control.


2 Replies

ED Eduardo June 27, 2025 03:51 AM UTC

Use FindAsync and SetValues ​​to update entities.

Make sure IdAvion is set to auto-increment.

Consider encapsulating DB access in a service for better control.

Geometry Arrow



PS Prathap Senthil Syncfusion Team June 27, 2025 01:13 PM UTC

Hi Eduardo,


Based on your requirements, we suggest ensuring that the IsIdentity property of the GridColumn is set to true for the primary key column. When IsIdentity is enabled, the column will be treated as read-only during editing or when adding a new record. Please refer to the provided documentation for more details.

API Link: https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridColumn.html#Syncfusion_Blazor_Grids_GridColumn_IsIdentity


Reference: https://blazor.syncfusion.com/documentation/datagrid/connecting-to-database/microsoft-sql-server


If the issue still persists, to further investigate the issue, we need additional clarification from your side. Please provide the following details to help us proceed:

  • To help us analyze the issue, could you provide a simple, reproducible sample that demonstrates the problem? This will allow us to identify the issue more effectively and provide a resolution.
  • Could you please share with us the grid code snippet with the model class?

The information you provide will be very helpful in validating the reported query on our end and in providing a solution as quickly as possible. Thank you for your understanding.

Regards,
Prathap Senthil


Loader.
Up arrow icon