Table Adapter Update Method

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.
 
G

Guest

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...
 
B

Branco Medeiros

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.
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top