<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Register TagPrefix="Hersh" TagName="nav" Src="nav.ascx" %>
<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)
	    '使用Fill方法填充dataset
	    myCommand.Fill(ds, "Masters")
	    Selection.DataSource=ds.Tables("Masters").DefaultView
	    Selection.DataBind()
    	End Sub
    </script>
    <body style="font: 10pt verdana; background-color:beige">
       <!---- 导航条 开始-------------->
                   <Hersh:nav id="menu" runat = server 
                   vGridlines = Both
                   vBorderColor = "Black"
                   vCellPadding = 7 />
       <!---- 导航条 结束-------------->
     <h3><font face="Verdana">Financial Account Selection</font></h3>
       <form  runat="server"  >  
	选择现金或银行帐户 :</B><asp:DropDownList DataTextField = "code_display"
	DataValueField = "code_value"  id="selection" runat="server"  />  
	<asp:Button  text="转到"  runat="server" OnClick="SubmitBtn_Click" />
       </form>
    </body>
</html>
