Public Class 商品信息查询
Inherits System.Web.UI.Page
#Region " Web 窗体设计器生成的代码 "
'该调用是 Web 窗体设计器所必需的。
Private Sub InitializeComponent()
End Sub
Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid
Protected WithEvents Ddlfl As System.Web.UI.WebControls.DropDownList
Protected WithEvents Ddlpm As System.Web.UI.WebControls.DropDownList
Protected WithEvents Ddlxh As System.Web.UI.WebControls.DropDownList
Protected WithEvents Ddlpp As System.Web.UI.WebControls.DropDownList
'注意: 以下占位符声明是 Web 窗体设计器所必需的。
'不要删除或移动它。
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: 此方法调用是 Web 窗体设计器所必需的
'不要使用代码编辑器修改它。
InitializeComponent()
End Sub
#End Region
Dim myd As New dataOP()
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
If Not IsPostBack Then
Dim ss() As String
ss = myd.rearr("select 分类名 from 分类")
Ddlfl.DataSource = ss
Ddlfl.DataBind()
Ddlfl.Items.Add("")
Ddlfl.SelectedIndex = Ddlfl.Items.Count - 1
datab("select * from 商品")
End If
End Sub
Private Sub Ddlfl_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Ddlfl.SelectedIndexChanged
Dim ss() As String
ss = myd.rearr("select distinct 品名 from 商品 where 分类='" & Ddlfl.SelectedItem.Text & "'")
Ddlpm.DataSource = ss
Ddlpm.DataBind()
Ddlpm.Items.Add("")
Ddlpm.SelectedIndex = Ddlpm.Items.Count - 1
datab("select * from 商品 where 分类='" & Ddlfl.SelectedItem.Text & "'")
End Sub
Sub datab(ByVal str As String)
DataGrid1.DataSource = myd.retab(str)
DataGrid1.DataBind()
End Sub
Private Sub Ddlpm_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Ddlpm.SelectedIndexChanged
Dim ss() As String
ss = myd.rearr("select distinct 品牌 from 商品 where 分类='" & _
Ddlfl.SelectedItem.Text & "' and 品名='" & Ddlpm.SelectedItem.Text & "'")
Ddlpp.DataSource = ss
Ddlpp.DataBind()
Ddlpp.Items.Add("")
Ddlpp.SelectedIndex = Ddlpp.Items.Count - 1
datab("select * from 商品 where 分