【datalgrid的编辑格式】
我把
种类的文本框的 编辑格式 变为多行的文本框后. 那个文本框,在更新时,的值怎成始终为 空字符串了.
我应该怎么引用这个文本框的更新值。
Private Sub DataGrid1_UpdateCommand(ByVal source As System.Object, _
ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) _
Handles DataGrid1.UpdateCommand
Dim mysql As String
Dim mycmd As OleDb.OleDbCommand
Dim myStr As String
myStr = e.Item.Cells(0).Text
Dim id As Integer = CInt(myStr)
Dim txt As String = e.Item.Cells(1).Text '编辑更新时. 这行怎么返回成 "" 了.
mysql = "update tab_pkinds set tab_pkinds.pkinds='" & txt & "'" & _
" where id=" & id
Response.Write(txt)
mycon.Open()
mycmd = New OleDb.OleDbCommand(mysql, mycon)
mycmd.ExecuteNonQuery()
mycon.Close()
DataGrid1.EditItemIndex = -1
BindGrid()
End Sub
[此贴子已经被作者于2006-10-25 14:37:16编辑过]
|