This is something very simple you may or may not have come across in your day-to-day dot net programming life. There are times when we use those entirely beautiful, full of great things, code-saving datasets in asp.net to make our lives easier. However, you may have noticed that there are times when the strongly typed dataset does not generate all of the required stored procedures even though you specified them when you set up the table adapter.
The reason is simple and the fix is simple too. The strongly typed dataset looks at your table to see if a primary key is defined. If your primary key is defined, then your delete and insert functions will be created. If you have been very bad and deserve a spanking and HAVE NOT defined a primary key, you will not see your Delete and Insert statements or stored procedures.
Now wasn't that simple?
Smooches,
Kila
Summary
Error: Delete & Insert stored procedures and statements are not generated in a strongly typed dataset
Cause: A Primary key is undefined on your table.
Fix: Define a primary key on your table and then define your dataset.
Comments anyone?
This blog is for all Microsoft & .net lovers who may find themselves in need of help or information once in a while. We all have questions and we all need to know more than we know right now. When I come across things that I think may be useful, I post it. When I have something to say that I think is important, which is everything, I post it. All of my C#, ASP.NET, VB, AJAX & programming friends around the world are welcome to the info in my blog - Ramblings Of A Crazy DotNet Woman!
Saturday, November 17, 2007
Are your strongly typed datasets not generating Delete & Insert statements & stored procedures?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment