请问DataGrid里面的Button的更改数据库的问题,请进。
<ItemTemplate>
<asp:Button id= "Btn_CheckOn " runat= "server " Text= "出社 " CommandName= "Btn_CheckOn_Click "> </asp:Button>
<asp:Button id= "Btn_CheckOf " runat= "server " Text= "退社 " CommandName= "Btn_CheckOf_Click "> </asp:Button>
</ItemTemplate>
Private Sub DataGrid1_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.ItemCommand
If e.CommandName = "Btn_CheckOn_Click " Then
Dim strb_sql As System.Text.StringBuilder
Dim obj_CLS_AL_FA001 As CLS_AL_FA001
With strb_sql
.Remove(0, .Length)
.Append( "UPDATE WORKTIME_INFO SET USER_ON = convert(varchar(5),getdate(),108) ")
.Append(vbCrLf)
.Append( "Where USER_ID = 'wei-h ' ")
.Append(vbCrLf)
.Append( "SYS_DATE= ' " + Func_Format8To10(Label2.Text)+ " ' ")
End With
...............
在这里运行到定义strb_sql的时候就会出错,为什么???
大虾救救我 项目很紧 很害怕
------解决方案--------------------你弄一简单的SQL试试。。。别搞的太复杂了