SqlDataAdapter not creating update/delete statements

  • Thread starter Thread starter Moily
  • Start date Start date
M

Moily

Hello,

I have a problem with VS.NET 2003 where it refuses to create the
UPDATE/DELETE statements when I use the "Configure Data Adapter" option on a
SqlDataAdapter. I am attempting to use the data adapter to provide a
straightforward "SELECT * FROM ..." on a single table, with a primary key
and full permissions set to all users. The table is a simple lookup (ie. ID
and DESCRIPTION columns).

I can browse and edit the design of the table with no problems at all using
VS.NET, and everything appears to be in order. I would presume from the
fact that the SELECT and INSERT statements being created correctly that it
has problems identifying the column with the PK. This is backed up by the
fact that the Query Builder dialog from the "Configure Data Adapter" only
shows the "All columns" option, and not the individual columns as well.
When I uss tables from the Northwind database, everything works fine and I
can see all columns in the Query Builder dialog.

What am I doing wrong ? How do I get the Data Adapter to pick up the column
definitions (as the VS.NET Server Explorer toolbox does) ?

Many thanks in advance.
 
Moily,

Don't know if you are interested in third pary controls, but we just
released a beta version of a set of controls called SQLCafe. They are
designed for use with vs.net and sqlserver. You can design data
access forms for your tables in literally minutes, and with writing
little or no code at all. Check out our info page
http://www.sqlcafe.net/DesktopDefault.aspx?tabid=30

Thanks,
(e-mail address removed)
 
Hi

I have only ever generated commands and schemas within code

I would suggest using the command builder, the same SQL statement and database connection. If this succeeds, the problem will point to a bug in VS.NET and some further investigations. If it fails you must ensure that the table has a primary key (not a unique key). Check the DataTable.PrimaryKey property and ensure that the array contains at least one item
 
Back
Top