c# - how to insert data in sql table using Linq without seting any primary key in table -
i have table in don't want specify primary key, after inserting records in using linq...aahhh...its giving error "can't perform create, update or delete operations on 'table(abc)' because has no primary key"
can ani 1 tell me how insert record without setting primary key. way im not setting primary key because table have bulk of data keep.
you can't use linq-to-sql directly tables don't have primary keys, because it's not supported.
if you're worried performance hit of indexing, can add stored procedure insert , add data context. it's bit more work, , it's not linq-to-sql, it'll method on call on data context.
there won't noticeable performance hit on identity primary key field anyway.
Comments
Post a Comment