Public Sub listcoursecode() Do While strsql = String.Empty strsql = "select * from [tblCourseTitle] where CourseCode like '%" & Trim(filtering.SelectedValue) & "%' Order by [CourseCode]Asc" Dim cmd As SqlCommand = New SqlCommand(strsql, cn) cn.Open() lbCourseCode.DataSource = cmd.ExecuteReader lbCourseCode.DataTextField = "CourseCode" lbCourseCode.DataValueField = "CourseTitle" lbCourseCode.DataBind() Loop cn.Close() strsql = String.Empty End Sub Protected Sub filtering_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles filtering.SelectedIndexChanged listcoursecode() End Sub End Class
strsql = "select * from [tblCourseTitle] where CourseCode like '" & Trim(filtering.SelectedValue) & "%' Order by [CourseCode]Asc"
like '%" & Trim(filter
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)