0

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

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by Mr.BunyRabit
0

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.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.