C
C#2mo ago
Masher.

Ensure that the records stay saved for the database

Could anyone help me at that example of a Insert, Update, Delete & Search Operation in C# with MS-Access Database? I want to make sure that everything gets from the database saved when I have made a change. Code:
50 Replies
Angius
Angius2mo ago
Oh boy, Access... Generally speaking, though... if you executed a query that saves something, and the execution did not throw an exception, it is safe to assume that it was saved
Masher.
Masher.2mo ago
The problem is there is no exception that shows me a mistake. That's why im asking If I have made a change in the datagridview then it doesn't save anything
Angius
Angius2mo ago
Granted, I never worked with OleDB, Access, or Winforms
Angius
Angius2mo ago
But this seems a little sus
No description
Angius
Angius2mo ago
Inserting a string where an integer should go? Would not surprise me if Ole just surrounded it with strings And if the database expects an integer... ...assuming Access can even make such expectations... ...it would cause an error
Masher.
Masher.2mo ago
I mean the other functions are still working. But I don't understand what it has to do with the saving record option?
Angius
Angius2mo ago
I just told you database want integer you give string string not integer database angry That's my best guess at least
Masher.
Masher.2mo ago
But it is a integer
Angius
Angius2mo ago
Far as I know, TextBox.Text is a string Unless something changed in Winforms in recent years
Masher.
Masher.2mo ago
but it should still work
Angius
Angius2mo ago
Does it?
Masher.
Masher.2mo ago
what could I do then? should I change it from access to a string
Angius
Angius2mo ago
Huh? Change from a database to a C# type? That... makes little sense Very little "None", one could say No, just make sure you give proper types If a field in the database is an integer, make sure that the parameter you pass there is an integer
Masher.
Masher.2mo ago
It is already what can I do then?
Angius
Angius2mo ago
Show me how you pass proper types now
Want results from more Discord servers?
Add your server