Last post Sep 30, 2013 01:53 PM by bbcompent1
Sep 25, 2013 05:58 PM|Mister_L|LINK
I'm using an xsd page to create a table adapter with a very simple select query: "SELECT * From MyTable". I'm working locally with sql express 2012, .NET 4.5, VS 2012.
In the designer, I check the "Generate Insert, Update, Delete" option, but in the end only the select query is generated (and works fine btw). I thought it might be a permission issue between my app and the sql server, but when I run an update query from
my code (using the SqlCommand class) ,it works perfectly ok. Anyone had a similar problem and can help?
Sep 25, 2013 06:21 PM|bbcompent1|LINK
You may not have indicated a primary key as in a recordid. In cases where a database table has no record id, those statements will not be auto-generated.
Sep 25, 2013 07:00 PM|Mister_L|LINK
My table has a primary key column, and I can see an icon of a key in the designer next to the column name.
Is that what you were referring to?
Sep 25, 2013 07:02 PM|bbcompent1|LINK
Ok, so then you do have it, alright, then it has to be something else. Let me dig and see what I can find.
Sep 25, 2013 07:05 PM|bbcompent1|LINK
Hm, I found one possible cause is you could be using joins, are you?
Sep 25, 2013 11:26 PM|Mister_L|LINK
No, its a simple select query without joins.
Sep 30, 2013 01:50 PM|bbcompent1|LINK
So you are only pulling records from just one table right?
Sep 30, 2013 01:53 PM|bbcompent1|LINK
I had one idea, maybe you could use stored procedures to do the CRUD work? It's cleaner and easier to maintain and ensures better separation of concerns.