主题:谁帮我解说一下这个什么意思呀?我刚学呀
Public Overrides Sub SaveForAdd()
Dim dr As DataRow = DataSet11.Tables("图书信息").NewRow()
Try
dr("条形码") = txbCode.Text.Trim
dr("编号") = txbNumber.Text.Trim
dr("书名") = txbName.Text.Trim
dr("类型") = cbbType.Text.ToString
dr("作者") = txbAuthor.Text.Trim
dr("译者") = txbTranslator.Text.Trim
dr("ISBN") = txbISBN.Text.Trim
dr("出版社") = cbbPress.Text.Trim
dr("价格") = txbPrice.Text.Trim
dr("页码") = txbTotalPages.Text.Trim
dr("操作员") = txbWorker.Text.Trim
dr("是否注销") = ckbRegist.Checked.ToString
dr("书架名称") = cbbBookcase.Text.Trim
dr("简介") = txbRemark.Text.Trim
Catch ex As Exception
MessageBox.Show(ex.ToString) '("数据格式不正确!")
Exit Sub
End Try
Try
DataSet11.Tables("图书信息").Rows.Add(dr)
If Me.DataSet11.HasChanges = True Then
SqlDataAdapter1.Update(DataSet11)
End If
Catch ex As Exception
MessageBox.Show("数据添加失败!")
End Try
LoadData()
dgdList.DataSource = dtData.DefaultView
End Sub
Dim dr As DataRow = DataSet11.Tables("图书信息").NewRow()
Try
dr("条形码") = txbCode.Text.Trim
dr("编号") = txbNumber.Text.Trim
dr("书名") = txbName.Text.Trim
dr("类型") = cbbType.Text.ToString
dr("作者") = txbAuthor.Text.Trim
dr("译者") = txbTranslator.Text.Trim
dr("ISBN") = txbISBN.Text.Trim
dr("出版社") = cbbPress.Text.Trim
dr("价格") = txbPrice.Text.Trim
dr("页码") = txbTotalPages.Text.Trim
dr("操作员") = txbWorker.Text.Trim
dr("是否注销") = ckbRegist.Checked.ToString
dr("书架名称") = cbbBookcase.Text.Trim
dr("简介") = txbRemark.Text.Trim
Catch ex As Exception
MessageBox.Show(ex.ToString) '("数据格式不正确!")
Exit Sub
End Try
Try
DataSet11.Tables("图书信息").Rows.Add(dr)
If Me.DataSet11.HasChanges = True Then
SqlDataAdapter1.Update(DataSet11)
End If
Catch ex As Exception
MessageBox.Show("数据添加失败!")
End Try
LoadData()
dgdList.DataSource = dtData.DefaultView
End Sub