Hi, I am using VB2010, I need to update data if it exists in the database and if it does not exists I need to insert. How to do it?
What sql should be bulild to update or insert in follow case?
Collapse
X
-
Depending on what SQL DBMS you're using, there may be merge type statement you can use. I don't know which one you're using so I can't tell you if it has one.
Otherwise, you can do a count to see if there is a record and run the appropriate insert or update. -
Thanks for your kind support.
That problem has been solved now. I tried first to insert and then to update, it worked successfully.
Now I have another problem that is, how to refresh one opened form from another form? I tried to reload, call Form_Load but the result was null.
Please help me.Comment
Comment