注册 登录
编程论坛 ASP.NET技术论坛

读不出SQL的数据怎么回事啊?

鬼首 发布于 2008-08-05 20:20, 540 次点击
<%@ 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>

照书上写的怎么,就是读不出来!不知道那里错了!
0 回复
1