(2005) DataSet not creating Insert & Update Commands

Denaes

Well-known member
Joined
Jun 10, 2003
Messages
956
I have two tables in a database (created in SQL 2005 Management Console) that are full on: Select, Insert, Update & Delete.

One Table (well call it customers) has had everything generated for it dynamically. All the commands and each command has all the parameters created and the logic for Update/Insert that is very... exaustive. A huge WHERE block.

The other Table (well call Address, isnt this DB unique!?) Has a dynamically generated Select & Insert command (complete with parameters and logic) but no Update or Delete command.

For some reason the generated parameters are all unique to the command and leave the TableAdapter level paramaters empty. So Id have to insert like 20 parameters and configure them manually - then make the SQL statements.

Ive removed the table and re-added it, Ive redone the TableAdaptors queries with the configure option on the context menu.

Now it wouldnt be terribly hard to to a DELETE and/or INSERT SQL statement. It would be annoying to create 20+ Parameters by hand.

The reason Im concerned is twofold:

1. By the time this project is done there will be at least 50 to 100 tables. maybe more. I want all non-customizable Commands done and done quick. Well move to stored procedures, but we often need to test things quickly when we create a table to see how things work.

2. If I do create the parameters & commands for this table and I need to update the datasource at a later date, Im afraid that whatever is causing these commands to not be created will remove the commands/parameters I create.

Whats wrong? I dont know. Any errors with this floating around that I dont know of? Anything I can select differently that might cause this problem? Maybe a datatype that VS.Net doesnt like?
 
Found the problem.

::drumroll:: I forgot to set a primary key in the database, so the dataset didnt know how to create the commands :eek:

lets here it for small, yet very important mistakes :D
 
Back
Top