标题:怎么读不了数据库啊?
只看楼主
鬼首
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2008-8-2
 问题点数:0 回复次数:0 
怎么读不了数据库啊?
<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="gb2312" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<%@Import Namespace="System.Data"%>
<%@Import Namespace="System.Data.SqlClient"%>
<script language="c#"runat="ktv">
void Page_Load(Object sender,EventArgse){
     SqlConnection Conn=new SqlConnection();
     Conn.ConnectionString="ktv=localhost;database=pubs;uid=sa;pwd="";
     Conn.Open();
     SqlCommadn Comm=new SqlCommand("select*from Authors",Conn);
     SqlDataReader dr=Comm.ExecuteReader();
     dg.DataSource=dr;
     dg.DataBind();
     Conn.Close();
     }
</script>
<asp:DataGrid id="dg"runat="ktv"/>
</body>
</html>
 麻烦告知一下那里错了?
搜索更多相关主题的帖子: Page 
2008-08-05 19:03



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-226934-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.099314 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved