Start New Discussion within our Software Development Community

Hey there.

So i have this database, that updates when i press the "update" button.

Now everything works good, until you dont enter a value into the primary key slot.
Now i know what the problem is, (you cant have that slot open). What i want to konw is what is the try statement that will catch that error, as i have no idea? None of the ones i tried worked.

Thank you
Ruan

Hey there.

So i have this database, that updates when i press the "update" button.

Now everything works good, until you dont enter a value into the primary key slot.
Now i know what the problem is, (you cant have that slot open). What i want to konw is what is the try statement that will catch that error, as i have no idea? None of the ones i tried worked.

Thank you
Ruan

Pffff, i found out which one. =)

try
                {
                    dAdapter.Update(dTable);
                }
                catch (System.Exception ex)
                {
                    MessageBox.Show("Update failed");
                }

Chow =)

This question has already been answered. Start a new discussion instead.