2006-11-10
Asp.Net2.0 SqlDataSource Selecting Selected用法
一個簡單的查詢資料庫
Protected Sub SqlDataSource1_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs)
If Page.IsPostBack And TextBox1.Text.Length <= 2 Then
e.Cancel = True
Response.Write("關鍵字太短...")
End If
End Sub
Protected Sub SqlDataSource1_Selected(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceStatusEventArgs)
Response.Write("查出" & e.AffectedRows & "筆")
End Sub
Protected Sub SqlDataSource1_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs)
If Page.IsPostBack And TextBox1.Text.Length <= 2 Then
e.Cancel = True
Response.Write("關鍵字太短...")
End If
End Sub
Protected Sub SqlDataSource1_Selected(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceStatusEventArgs)
Response.Write("查出" & e.AffectedRows & "筆")
End Sub