请问大家我编写一个查询程序,可实现在查询结果的表中数据上直接修改。可现在查询结果能够显示,为什么不能在表中直接修改数据呢?谁能帮我编一下怎么实现在表中直接修改数据?谢谢了,下面是我查询的代码:
Private sql As String = "SELECT * FROM workerTab "
Private Sub BtnFin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnFin.Click
sql += " where 工人姓名 like'" + Me.CbxName.Text.Trim + "%'"
sql += " AND 日期 <='" & Me.TbxTime2.Text.Trim() & "'and 日期 >='" & Me.TbxTime1.Text.Trim() & "'"
Me.BindDg()
End Sub
Private Sub BindDg()
Dim dtNew As DataTable
Dim SqlAda As New SqlDataAdapter
Dim SqlCmd As New SqlCommand(sql, DataSql.SqlCon)
Dim ds As New DataSet
Try
SqlAda.SelectCommand = SqlCmd
ds.Clear()
SqlAda.Fill(ds)
Me.DataGrid1.DataSource = ds.Tables(0)
Catch ex As Exception
DataSql.WriteErr(ex)
End Try
End Sub
请问直接在查询结果中修改数据的代码怎么编呢?
[求助] 请问这样的数据修改情况怎么编写?