急!救救我呀!!我在从库里读数据时出现了以下错误!!
我的程序是:
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="gb2312"%>
<%@ import namespace="system.data"%>
<%@ import namespace="system.data.sqlclient" %>
<script language="VB" runat="server">
sub page_load(obj as object,e as eventargs)
dim connstrasstring="server=whh;database=sun;userid=sun;password=sun;"
dim conn as new sqlconnection(connstr)
dim objad as sqldataadapter
dim ds as dataset
conn.open
objad=new sqldataadapter("select dpimg from prod where idx<100",conn)
ds=new dataset
objad.fill(ds)
datagrid1.datasource=ds
datagrid1.databind()
end sub
sub datagrid1_pageindexchanged(obj as object,e as datagridpagechangedeventargs)
datagrid1.currentpageindex=e.newpageindex
databind
end sub
</script>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body topmargin="0" style="background-image: url('images/pic000/bg.gif')">
<table width="780" align="center" bgcolor="#ffffff" border="0">
<tr><td>
<form ruant="server">
<table width="100%" align="center" border="0"><tr><td>
<asp:datagrid ID="datagrid1" runat="server" AutoGenerateColumns="false" AllowPaging="true" OnPageIndexChanged="datagrid1_pageindexchanged" >
<columns>
<asp:templatecolumn>
<itemtemplate>
<table width="100%" bgcolor="#ffffff">
<tr><td> <img src='<%# container.dataitem("dpimg") %>'>
</td></tr>
</table>
</itemtemplate>
</asp:templatecolumn>
</columns>
</asp:datagrid>
</td></tr></table>
</form>
</td></tr>
</table>
</body>
</html>
就是一个简单的输出,可是出现了以下错误:
Control 'datagrid1__ctl14__ctl1' of type 'DataGridLinkButton' must be placed inside a form tag with runat=server.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Control 'datagrid1__ctl14__ctl1' of type 'DataGridLinkButton' must be placed inside a form tag with runat=server.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
请大家来帮帮,谢谢,急