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
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
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
Granted, I never worked with OleDB, Access, or Winforms
But this seems a little sus
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
I mean the other functions are still working. But I don't understand what it has to do with the saving record option?
I just told you
database want integer
you give string
string not integer
database angry
That's my best guess at least
But it is a integer
Far as I know,
TextBox.Text
is a string
Unless something changed in Winforms in recent yearsbut it should still work
Does it?
what could I do then?
should I change it from access to a string
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
It is already
what can I do then?
Show me how you pass proper types now