datatables Cannot retrieve inserted id - no primary key was found.

datatables Cannot retrieve inserted id - no primary key was found.

MundaringMundaring Posts: 34Questions: 12Answers: 1

I have an auto increment Id field in my SQL Server table. When I am trying to insert new rows from dataTable I am getting this error. I noticed it is just when the table belong to a different schema than dbo. Is there any solution for this?

Thanks,

Wilson

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    I think your other thread also covers this. I suspect it is a schema issue I'm afraid. The Editor SQL currently uses some "cunning" (i.e. fragile) code to try and workout what field the primary key is in for the insert. I've got a better idea for that that I need to experiment with a bit.

    Allan

  • MundaringMundaring Posts: 34Questions: 12Answers: 1

    Finally I removed the schema in my current project, but it would be great to allow using schemas.

    Thanks,

    Wilson

This discussion has been closed.