我照着书上的写程序结果没办法更新,请各位大虾帮我看一下,问题出在哪里。更新程序代码如下: Dim cn As SqlClient.SqlConnection = New SqlClient.SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))
        Dim tname, tlink As TextBox
        tname = e.Item.Cells(2).Controls(0)        ' tlink = e.Item.Cells(2).Controls(0)
        Dim cmd As New SqlClient.SqlCommand("update sec_link set name='" & tname.Text & "'where id=" & Datagrid2.DataKeys(CInt(e.Item.ItemIndex)), cn)        cn.Open()
        cmd.ExecuteNonQuery()
        cn.Close()
        Datagrid2.EditItemIndex = -1
        bind()运行后tname.Text 的值还是原来数据库里的值,我修改的不知道在哪里了。