Table Adapter Update Method

  • Thread starter Thread starter Mohamed Shafiee
  • Start date Start date
M

Mohamed Shafiee

Hi,

I'm trying to build a database application in Visual Studio 2005. The
language which I'm using is vb.net . I created a new Windows Application,
added a database, created a table, and then used the Configure Dataset
wizard to create a tableset with the new table Table 1. I dragged the
tableset into the form, and Visual Studio 2005 miraculously created a very
nice form for the table. But the problem is, the Save button in the Binding
Navigator control doesn't work. It doesn't give an error, but when I close
the form and open the table to view its data, I can't find the newly entered
data. Any idea how I can make it work?

Shafiee.
 
Thanks for the post Mr. Cor.

Last night I figured that it is because I didn't set the DeleteCommand,
UpdateCommand, and InsertCommand properties of the tableset object. Is that
the reason? Those are set to none by default. Do you know how to set those
properties?

Thanks in advance...
 
Shafiee said:
Last night I figured that it is because I didn't set the DeleteCommand,
UpdateCommand, and InsertCommand properties of the tableset object. Is that
the reason? Those are set to none by default. Do you know how to set those
properties?

The designer will create the Delete, Update and Insert commands for you
if it can gather enough information from your table. Specifically (as
for my *little* experience), it will require at least a primary key in
your table.

Because it seems you're just experimenting with the technology, I'd
suggest you delete the dataset created by the wizard, go back to your
table, add a primary key to it and try the wizard again.

Notice, also, that the Delete/Update/Insert methods won't be created if
the GenerateDBDirectMethods property of the table's TableAdapter is set
to false. If this is the case, set it to true (in the dataset designer,
click the title of the table's TableAdapter window to see the adapter's
properties) and save the dataset, so the designer will create the
methods automagically.

HTH.

Regards,

Branco.
 
Thank you... I will try that. :)

Branco Medeiros said:
The designer will create the Delete, Update and Insert commands for you
if it can gather enough information from your table. Specifically (as
for my *little* experience), it will require at least a primary key in
your table.

Because it seems you're just experimenting with the technology, I'd
suggest you delete the dataset created by the wizard, go back to your
table, add a primary key to it and try the wizard again.

Notice, also, that the Delete/Update/Insert methods won't be created if
the GenerateDBDirectMethods property of the table's TableAdapter is set
to false. If this is the case, set it to true (in the dataset designer,
click the title of the table's TableAdapter window to see the adapter's
properties) and save the dataset, so the designer will create the
methods automagically.

HTH.

Regards,

Branco.
 
Back
Top