查看完整版本: 懂ASP.NET的麻烦进一下!

BenyMo 2008-8-4 22:03

懂ASP.NET的麻烦进一下!

<%@ Page Language=&quot;C#&quot; ContentType=&quot;text/html&quot; ResponseEncoding=&quot;gb2312&quot; %>
<!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;>
<html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;>
<head>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=gb2312&quot; />
<title>无标题文档</title>
</head>
<body>
<%@Import Namespace=&quot;System.Data&quot;%>
<%@Import Namespace=&quot;System.Data.SqlClient&quot;%>
<script language=&quot;c#&quot;runat=&quot;ktv&quot;>
void Page_Load(Object sender,EventArgse){
     SqlConnection Conn=new SqlConnection();
         Conn.ConnectionString=&quot;ktv=localhost;database=pubs;uid=sa;pwd=&quot;&quot;;
         Conn.Open();
         SqlCommadn Comm=new SqlCommand(&quot;select*from Authors&quot;,Conn);
         SqlDataReader dr=Comm.ExecuteReader();
         dg.DataSource=dr;
         dg.DataBind();
         Conn.Close();
         }
</script>
<asp:DataGrid id=&quot;dg&quot;runat=&quot;ktv&quot;/>
</body>
</html>

照书上做的!就是读不出SQL数库!那里错了啊?

页: [1]
查看完整版本: 懂ASP.NET的麻烦进一下!
哈尔滨房产网 ONLY 齐齐哈尔房产网 齐齐哈尔鹤城青华 齐齐哈尔大学 齐齐哈尔医学院 齐齐哈尔职业学院 齐齐哈尔师范高等专科学校
哈尔滨网站建设 演唱会  Levis 李维斯 Levi's 齐齐哈尔信息网  设计之战