posts - 9,  comments - 0,  trackbacks - 0
<%@ Page Language="VB" Debug="true" trace="true" %>
<%@ Import NameSpace="System.Data" %>
<%@ Import NameSpace="System.data.SQLClient" %>
<script language="VB" runat="server">
Sub Page_Load(sender as object, E as eventargs)
Dim ds as DataSet
Dim MyConnection as SQLConnection
Dim MyAdpt as SQLDataAdapter
MyConnection =New SQLConnection("server='localhost';UID=sa;PWD=wenasen.com; database=credit_sql")
MyAdpt = New SQLDataAdapter("select * from admin",MyConnection)
ds= new DataSet()
MyAdpt.Fill(ds,"admin")
dgA.DataSource=ds.tables("admin").defaultView
dgA.DataBind()
end sub
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>显示SQL数据库</title>
</head>
<body>
<form id="form1" runat="server">
<asp:datagrid id="dgA" runat="server" AllowPaging="true" Width="100%" CellPadding="1" EditItemStyle-BackColor=""
HeaderStyle-BackColor="#00CCCC" border="1" AlternatingItemStyle-BackColor="#CCCCCC"
></asp:datagrid>
</form>
</body>
</html>
posted on 2006-11-19 17:49 MT'S BLOG 阅读(378) 评论(0)  编辑 收藏 引用 所属分类: 参考文
只有注册用户登录后才能发表评论。

<2024年12月>
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

常用链接

留言簿(1)

随笔分类

随笔档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜