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

怎么读不了数据库啊?

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