Salut,
Cineva care ma poate ajuta cu o solutie la problema de mai jos. Lucrez la o aplicatie in vb.net. Aduc datele dintr-o tabela intr-un datagrid, in care vreau sa editez diverse valori, din diverse celule, dupa care sa le salvez in aceeasi tabela.
Codul este cel de mai jos. Problema este ca-mi da eroare de mai jos...
"NullReferenceException occurrent
A first chance exception of type 'System.NullReferenceException' occurred in .... "
Private Sub btnsave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
Try
connection.Open()
sBuilder = New SqlCommandBuilder(sAdapter)
btnLoad.Enabled = False
sAdapter.Update(sDataSet)
sDataSet = Nothing
btnModify.Enabled = True
btnLoad.Enabled = True
btnLoad.PerformClick()
MessageBox.Show("Information updated", "Update", MessageBoxButtons.OK, MessageBoxIcon.Information)
Catch ex As Exception
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
connection.Close()
End Try
End Sub
https://drive.google.com/file/d/1O4rM2UFTmwgFIObgbXakzwSyETrBMpx9/view?usp=sharing
Multumesc anticipat!