深入浅出ASP.NET程序设计-源代码 书籍语言: 简体中文 书籍类型: 程序设计 授权方式: 免费软件 书籍大小: 627 KB

源代码在线查看: ch16-03-02.aspx

软件大小: 628 K
上传用户: bandagemaster
关键词: 书籍 ASP 627 NET
下载地址: 免注册下载 普通下载 VIP

相关代码

				
				
				
				
				
				Ch16-03-02.aspx 以DataReader对象作为数据来源
				
				Sub Page_Load(Obj As Object, e As EventArgs)
				If Not IsPostBack Then
				Dim DSN As String
				Dim tSQL As String = "Select * From UserDatas"
				Dim OBJConn As OleDbConnection
				DSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
				            Server.MapPath("/ASP/chap14/ASP.NET网页数据库.mdb") & ";"
				OBJConn = New OleDbConnection(DSN)
				OBJConn.Open()
				Dim OBJCmd As OleDbCommand = New OleDbCommand(tSQL, OBJConn)
				RadioList1.DataSource = OBJCmd.ExecuteReader()
				RadioList1.DataTextField = "UserName"
				RadioList1.DataBind()
				OBJConn.Close()
				End If
				End Sub
				Sub Button1_Click(Obj As Object, e As EventArgs)
				Label1.Text = "用户选择:" & RadioList1.SelectedItem.Text
				End Sub
				
				
				
				
				
								                   OnClick="Button1_Click" Runat="Server" />
								                   BorderColor="#FF00FF" Runat="Server" />
				
				
				
							

相关资源