I am new to C#
guys so please be kind and any help is appreciated :).
My save button
is not retaining the information that it should on the sql
database and I'm slightly perplexed as to why?
This is my code below...
private void btnSave_Click(object sender, EventArgs e)
{
try
{
InformationBindingSource.EndEdit();
test.SaveChangesAsync();
panel.Enabled = false;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
InformationBindingSource.ResetBindings(false);
}
}
What I don't understand is that on the sql server profiler
it recognises the connection and the button also claims to store the information. Although, if a restart the project and start it back up, or look in sql
, the information isn't there.
I have also declared the "entity.infrastructure
" and I've just come to a stand still with no idea why it's not storing the information :(
Copyright Notice:Content Author:「SteveMcManamen」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/32222440/save-button-not-storing-information-within-the-sql-database