扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:佚名 来源:CSDN 2007年11月6日
关键字: Windows
<script runat="server"> Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) BulletedList1.DataSource = GetAuthorsByState("CA") BulletedList1.DataBind() End Sub Shared Function GetAuthorsByState(ByVal state As String) As System.Data.DataSet Dim connectionString As String = "server=(local); database=pubs; trusted_connection=true" Dim dbConnection As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection(connectionString) Dim queryString As String = "SELECT [authors].[au_id], [authors].[au_fname], [authors].[au_lname], [authors]. [state] FROM [authors] WHERE ([authors].[state] = @state)" Dim dbCommand As System.Data.IDbCommand = New System.Data.SqlClient.SqlCommand dbCommand.CommandText = queryString dbCommand.Connection = dbConnection Dim dbParam_state As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter dbParam_state.ParameterName = "@state" dbParam_state.Value = state dbParam_state.DbType = System.Data.DbType.StringFixedLength dbCommand.Parameters.Add(dbParam_state) Dim dataAdapter As System.Data.IDbDataAdapter = New System.Data.SqlClient.SqlDataAdapter dataAdapter.SelectCommand = dbCommand Dim dataSet As System.Data.DataSet = New System.Data.DataSet dataAdapter.Fill(dataSet) Return dataSet End Function </script> <html><head runat="server"><title>Untitled Page/title></head> <body> <form id="form1" runat="server"><div> <asp:BulletedList ID="BulletedList1" DataTextField= "au_lname" Runat="server" /> </div></form> </body></html> |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者