标题:代码错在哪
取消只看楼主
23760639
Rank: 1
等 级:新手上路
帖 子:277
专家分:0
注 册:2005-5-13
 问题点数:0 回复次数:0 
代码错在哪

Private Sub DataGrid1_UpdateCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.UpdateCommand
DataGrid1.EditItemIndex = -1

Dim name1 As TextBox = e.Item.Cells(1).Controls(0)

mycom.Connection = con
con.Open()
myadp.SelectCommand = mycom
mycom.CommandType = CommandType.Text
mycom.CommandText = "update contact set name='" + name1.Text.ToString() + "'"
mycom.ExecuteNonQuery()
con.Close()

End Sub

红色的那句好象不对,应该怎么改,运行时候说“无效的类型转换”

搜索更多相关主题的帖子: 代码 
2006-05-10 10:06



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-63021-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.560162 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved