扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:佚名 来源:yesky 2007年11月8日
关键字: Windows
<%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.SqlClient" %> <HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"> <STYLE> BODY { font:arial } H1 { color:navy } </STYLE> </HEAD> <BODY> <DIV align=center> <H1>Authors</H1> |
< script language="VB" runat="server"> Sub Page_Load(Src As Object, E As EventArgs) Dim DS As DataSet Dim MyConnection As SQLConnection Dim MyCommand As SQLDataAdapter MyConnection = New SQLConnection("server=localhost;uid=sa;pwd=;database=pubs") MyCommand=New SQLDataAdapter("select au_fname as 'First Name', au_lname as 'Last Name',Phone from Authors",MyConnection) |
DS = new DataSet() MyCommand.Fill(ds,"Authors") |
grdAuthors.DataSource=ds.Tables("Authors").DefaultView |
grdAuthors.DataBind() End Sub </script> |
<asp:DataGrid runat=server id=grdAuthors/> <!-- Footer --> <h5>Current as of <%Response.Write (Now.ToString)%></h5> </DIV> </BODY> </HTML> |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。