当前位置:中国站长下载文章中心网页编程.NET编程 → 在DataGrid快速添加新行

在DataGrid快速添加新行

减小字体 增大字体 作者:不详  来源:不详  发布时间:2006-8-14 9:09:53
temCommand
   If e.CommandName = "Insert" Then
   Dim cnn As New SqlConnection(connstr)
   Dim t1 As TextBox = e.Item.FindControl("textbox2")
   Dim t2 As TextBox = e.Item.FindControl("textbox4")
   cnn.Open()
   Dim cmd As New SqlCommand("insert into employees(lastname,firstname) values('" & t1.Text & "','" & t2.Text & "')", cnn)
   cmd.ExecuteNonQuery()
   cnn.Close()
   BindGrid()
   End If
   End Sub
  End Class
  
  
    做人要厚道,请注明转自chinazhan中国站长(www.ChinaZhan.com)。

上一页  [1] [2]