0
你好我有一个问题,当我点击进入数据网格我总是得到这个问题我目前正在做这个更新,我使用数据网格视图使我更容易点击数据网格,更新按钮将被启用,当我点击更新按钮时,它将进入form4维护模块。但不幸的是,错误“从类型'DBNull'转换类型'字符串'是无效的”得到的总是在我的方式,所以我可以到那一部分,请帮助我的谢谢,再次抱歉我的英语不好:))DBNull类型字符串是无效--- Visual Studio 2005
Form4.txtEmpLastname.Text = dgvEmployeeRecords.Item("Lastname", dgvEmployeeRecords.CurrentRow.Index).Value
Form4.txtEmpFirstname.Text = dgvEmployeeRecords.Item("Firstname", dgvEmployeeRecords.CurrentRow.Index).Value
Form4.txtEmpMiddlename.Text = dgvEmployeeRecords.Item("Middlename", dgvEmployeeRecords.CurrentRow.Index).Value
Form4.txtEmpAddress.Text = dgvEmployeeRecords.Item("CityAddress", dgvEmployeeRecords.CurrentRow.Index).Value
Form4.txtEmpAge.Text = dgvEmployeeRecords.Item("Age", dgvEmployeeRecords.CurrentRow.Index).Value
Form4.txtEmpBirthdate.Text = dgvEmployeeRecords.Item("Birthdate", dgvEmployeeRecords.CurrentRow.Index).Value
Form4.txtEmpBirthplace.Text = dgvEmployeeRecords.Item("Birthplace", dgvEmployeeRecords.CurrentRow.Index).Value