Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Session("user") <> Nothing Then If Not Page.IsPostBack Then Dim OrderPercent As New Percent OrderPercentDropDownList.DataSource = OrderPercent.GetPercent OrderPercentDropDownList.DataBind() Dim DBS As New DataBaseAccess DBS.SetConn() Dim Con As OracleConnection Con = DBS.GetConn Dim empid As String empid = Session("empid") NameAdapter.SelectCommand.Connection = Con NameAdapter.SelectCommand.CommandText = NameAdapter.SelectCommand.CommandText & " where " & """Employ_id2""" & "='" & empid & "'" Dim Ds As New DataSet NameAdapter.Fill(Ds, "Name") PuNameDropDownList.DataSource = Ds PuNameDropDownList.DataMember = "Name" PuNameDropDownList.DataTextField = "Name" PuNameDropDownList.DataBind() Dim FalseCondition As String FalseCondition = " and 1 < 0 " SetPurchaseView(FalseCondition) End If Else Server.Transfer("/crm/errormessage/accesserror.aspx") End If
有无为你的datagrid数据绑定
要是这样把Panel的visible属性改为true
If Session("user") <> Nothing Then
If Not Page.IsPostBack Then
Dim OrderPercent As New Percent
OrderPercentDropDownList.DataSource = OrderPercent.GetPercent
OrderPercentDropDownList.DataBind()
Dim DBS As New DataBaseAccess
DBS.SetConn()
Dim Con As OracleConnection
Con = DBS.GetConn
Dim empid As String
empid = Session("empid") NameAdapter.SelectCommand.Connection = Con
NameAdapter.SelectCommand.CommandText = NameAdapter.SelectCommand.CommandText & " where " & """Employ_id2""" & "='" & empid & "'"
Dim Ds As New DataSet
NameAdapter.Fill(Ds, "Name") PuNameDropDownList.DataSource = Ds
PuNameDropDownList.DataMember = "Name"
PuNameDropDownList.DataTextField = "Name"
PuNameDropDownList.DataBind() Dim FalseCondition As String
FalseCondition = " and 1 < 0 "
SetPurchaseView(FalseCondition)
End If
Else
Server.Transfer("/crm/errormessage/accesserror.aspx")
End If
2.是不是把datagrid中的在运行时自动创建列给勾掉了!