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 =)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.