Opened 15 years ago

Last modified 4 months ago

#550 new defect

SQL Spatial - poor error message when trying to insert into a table without a primary key

Reported by: chriserickson Owned by: brentrobinson
Priority: major Milestone: 4.2.0
Component: FDO API Version: 3.4.0
Severity: 3 Keywords:
Cc: External ID:

Description

I have created a basic table in SQL 2008, with 3 fields: ID (char[36]), Shape (Geometry), Description (varchar(255).

When I try and insert data, I’m getting an error: “Creating/Updating a standalone instance for class 'TestGeometry' is not allowed.”

Here is a snippet of when it is happening:

IInsert insertCommand = (IInsert)_database._connection.CreateCommand(CommandType.CommandType_Insert);

insertCommand.SetFeatureClassName(_class.QualifiedName); <- happens on this line.

It turns out this is caused by the table not having a primary key set. The error message is not helpful in discerning the cause of the error.

Change History (2)

comment:1 by gregboone, 14 years ago

Milestone: 3.5.03.6.0
Owner: changed from gregboone to brentrobinson

comment:2 by jng, 4 months ago

Milestone: 3.6.04.2.0
Note: See TracTickets for help on using tickets.