?? default.aspx.vb
字號:
Partial Class _default
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
Private Sub dpTipo_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dpTipo.SelectedIndexChanged
Dim valor As String = dpTipo.SelectedItem.Value
Select Case valor
Case "1"
imgGrafico.Visible = True
imgGrafico.ImageUrl = "GerarGrafico.aspx?xvalues=Compras tetsttet tettte|Vendas&yvalues=9|10&tipo_grafico=Barra"
Case "2"
imgGrafico.Visible = True
imgGrafico.ImageUrl = "GerarGrafico.aspx?xvalues=Compras tetsttet tettte|Vendas&yvalues=600|1000&tipo_grafico=Pizza"
Case "3"
imgGrafico.Visible = True
imgGrafico.ImageUrl = "GerarGrafico.aspx?xvalues=Compras tetsttet tettte|Vendas&yvalues=5600|1000&tipo_grafico=Barra2"
Case "4"
imgGrafico.Visible = True
imgGrafico.ImageUrl = "GerarGrafico.aspx?tipo_grafico=Barra2&" + db()
Case "5"
imgGrafico.Visible = True
imgGrafico.ImageUrl = "GerarGrafico.aspx?tipo_grafico=Pizza&" + db()
Case Else
imgGrafico.Visible = False
End Select
End Sub
Function db() As String
Dim da As New System.Data.SqlClient.SqlDataAdapter("select top 10 CustomerID ID,Freight TOTAL from Orders", "Data Source=127.0.0.1;User ID=sa;Password=;Initial Catalog=NorthWind")
Dim dt As New DataTable
da.Fill(dt)
Dim i As Int32
Dim xvalues As New System.Text.StringBuilder
Dim yvalues As New System.Text.StringBuilder
For i = 0 To dt.Rows.Count - 1
If i <> 0 Then
xvalues.Append("|")
yvalues.Append("|")
End If
xvalues.Append(dt.Rows(i)(0))
yvalues.Append(dt.Rows(i)(1))
Next
Return "xvalues=" + xvalues.ToString + "&" + "yvalues=" + yvalues.ToString
End Function
End Class
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -