?? selection.aspx
字號:
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<html>
<script language="VB" runat="server">
Dim myConnection As OleDbConnection
Dim myCommand As OleDbDataAdapter
Dim ds As New DataSet
Dim ConnStr As String
Dim SQL As String
Sub Page_Load(Source As Object, E As EventArgs)
ConnStr = "Provider=SQLOLEDB; Data Source=(local); Initial Catalog=ASPNET;User ID=sa;"
myConnection = New OleDbConnection(ConnStr)
if NOT (isPostBack)
rebind
end if
End Sub
Sub SubmitBtn_Click(sender As Object, e As EventArgs)
Session("TheSelectionText")= Selection.SelectedItem.Text
Session("TheSelectionValue")= Selection.SelectedItem.Value
Response.Redirect("Transactions.aspx")
End Sub
Sub ReBind()
'DataSetCommand
SQL = "Select * from masters where code_category in (604,605) order by code_display"
myCommand = New OleDbDataAdapter(SQL, myConnection)
'use Fill method of DataSetCommand to populate dataset
myCommand.Fill(ds, "Masters")
Selection.DataSource=ds.Tables("Masters").DefaultView
Selection.DataBind()
End Sub
</script>
<body>
<h3><font face="Verdana">Financial Account Selection</font></h3>
<form runat="server" >
Select Cash or Bank Account :</B><asp:DropDownList DataTextField = "code_display"
DataValueField = "code_value" id="selection" runat="server" />
<asp:Button text="Go" runat="server" OnClick="SubmitBtn_Click" />
</form>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -