主题:新手,求助,数据库连接
麻烦帮我看一下,运行以下这个程序时,报错"分析器错误信息: 未能从程序集 System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 中加载类型 System.Web.UI.WebControls.DataGird。"请问应该怎样修改程序? (后台的数据库已经建好了,环境也配置好了,是不是还要设置什么?)
多谢.
<%@ Page Language="vb" Debug="true" %>
<%@ Import NameSpace="System.Data" %>
<%@ Import NameSpace="System.Data.SQLClient" %>
<%@ Import NameSpace="System.Web.UI.WebControls.DataGird" %>
<html>
<head>
<title>DataReader</title>
</head>
<h3 align=center>DataReader对象读取数据实例</h3>
<Script runat="server">
Sub Page_Load(Sender As Object,E As EventArgs)
Dim myConnection As New SqlConnection
myConnection=new SqlConnection("server=(local);uid=sa;pwd=sa;database=student")
Dim myCommand As New SQLCommand
myCommand=New SqlCommand("SELECT * FROM student1",myConnection)
myConnection.Open()
Dim DR As SqlDataReader=myCommand.ExecuteReader()
myDataGird.DataSource=DR
myDataGird.DataBind()
MyConnection.Close()
End Sub
</Script>
<body>
<aspataGird id="myDataGird" runat="server"
Widht="700"
BackColor="#ccccff"
BorderColor="Black"
ShowFooter="false"
CellPadding=3
CellSpace="0"
Font-Name="宋体"
Font-Size="8pt"
HeaderStyle-BackColor="#aaaadd"
EnableViewState="false"
/>
</body>
</html>
多谢.
<%@ Page Language="vb" Debug="true" %>
<%@ Import NameSpace="System.Data" %>
<%@ Import NameSpace="System.Data.SQLClient" %>
<%@ Import NameSpace="System.Web.UI.WebControls.DataGird" %>
<html>
<head>
<title>DataReader</title>
</head>
<h3 align=center>DataReader对象读取数据实例</h3>
<Script runat="server">
Sub Page_Load(Sender As Object,E As EventArgs)
Dim myConnection As New SqlConnection
myConnection=new SqlConnection("server=(local);uid=sa;pwd=sa;database=student")
Dim myCommand As New SQLCommand
myCommand=New SqlCommand("SELECT * FROM student1",myConnection)
myConnection.Open()
Dim DR As SqlDataReader=myCommand.ExecuteReader()
myDataGird.DataSource=DR
myDataGird.DataBind()
MyConnection.Close()
End Sub
</Script>
<body>
<aspataGird id="myDataGird" runat="server"
Widht="700"
BackColor="#ccccff"
BorderColor="Black"
ShowFooter="false"
CellPadding=3
CellSpace="0"
Font-Name="宋体"
Font-Size="8pt"
HeaderStyle-BackColor="#aaaadd"
EnableViewState="false"
/>
</body>
</html>