Ссылка на объект нулевой экземпляр объекта
Imports System Imports System.Collections.Generic Imports System.ComponentModel Imports System.Data Imports System.Drawing Imports System.Linq Imports System.Text Imports System.Windows.Forms Public Class Form1 Private Sub DataGridView1_CellBeginEdit(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellCancelEventArgs) Handles DataGridView1.CellBeginEdit Dim row As New DataGridViewRow For Each row In DataGridView1.Rows row.Cells(DataGridView1.Columns("total").Index).Value = (Convert.ToDouble(row.Cells(DataGridView1.Columns("todayattendence").Index).Value) + Convert.ToDouble(row.Cells(DataGridView1.Columns("oldattendence").Index).Value)) Next End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'BanDataSet.Table1' table. You can move, or remove it, as needed. Me.Table1TableAdapter.Fill(Me.BanDataSet.Table1) End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click On Error GoTo saveErr Table1BindingSource.EndEdit() Table1TableAdapter.update(BanDataSet.Table1) MessageBox.Show("ok saved") saveErr: End Sub End Class
Что я уже пробовал:
я попытался обновить databasetable ms access через datagridview, но в datagridview есть одно условие один столбец + два столбца =третий столбец