【文章內(nèi)容簡介】
Web 窗體設計器生成的代碼 () Private Sub InitializeComponent() End Sub Private Sub Page_Init(ByVal sender As , ByVal e As ) Handles InitializeComponent() End Sub End Region Private Sub Page_Load(ByVal sender As , ByVal e As ) Handles 《 Web 程序設計》課程設計 9 If Session(reguser) = Then () End If If Not Then Dim myConnection As New SqlConnection(Data Source=.\SQLEXPRESS。AttachDbFilename=E:\Blog\WebApplication1\App_data\。Integrated Security=True。Connect Timeout=30。User Instance=True) 39。2. 建立 Command對象 Dim strSQL As String = select * from diarytable where username= amp。 39。 amp。 Session(reguser) amp。 39。 Dim myCommand As New SqlCommand(strSQL, myConnection) 39。 DataAdapter Dim myDA As New SqlDataAdapter = myCommand 39。4. 組件 DataSet Dim myDS As New DataSet (myDS) = myDS () End If 39。 End Sub Private Sub DataGrid1_EditCommand(ByVal source As Object, ByVal e As ) Handles = bindgrid() End Sub Private Sub DataGrid1_CancelCommand(ByVal source As Object, ByVal e As ) Handles = 1 End Sub Sub bindgrid() Dim myConnection As New SqlConnection(Data Source=.\SQLEXPRESS。AttachDbFilename=E:\Blog\WebApplication1\App_data\。Integrated Security=True。Connect Timeout=30。User Instance=True) 39。2. 建立 Command對象 Dim strSQL As String = select * from diarytable where username= amp。 39。 amp。 Session(reguser) amp。 39。 Dim myCommand As New SqlCommand(strSQL, myConnection) 39。 DataAdapter Dim myDA As New SqlDataAdapter = myCommand 39。4. 組件 DataSet Dim myDS As New DataSet 《 Web 程序設計》課程設計 10 (myDS) = myDS () End Sub Private Sub Button1_Click(ByVal sender As , ByVal e As ) Handles () End Sub Private Sub Button2_Click(ByVal sender As , ByVal e As ) Handles Dim i As Integer Dim item As DataGridItem 39。Dim dr As DataRow 39。Dim title, price As String For i = 0 To 1 item = (i) Dim bookcheckbox As CheckBox = (checkbox1) If Then deletedataset(CInt((0).Text)) End If Next bindgrid() End Sub Sub deletedataset(ByVal i As Integer) Dim con As New SqlConnection(Data Source=.\SQLEXPRESS。AttachDbFilename=E:\Blog\WebApplication1\App_data\。Integrated Security=True。Connect Timeout=30。User Instance=True) Dim cmd As SqlCommand Dim qry As String () qry =