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

End of statement expected.

tm_ma 发布于 2007-03-23 20:29, 2007 次点击

我的程序如下,看了好多遍,看不处有什么错误啊.感谢各位不厌其烦的看完我的帖子,辛苦了.
____________________________________________________________________________
<%@ import namespace="systeml.data"%>
<%@ import namespace="system.data.oledb"%>
<script language="vb" runat="server">
sub page_load(sender as object,e as eventargs)
dim conn as new oledbconnection("provider=microsoft.jet.oledb.4.0;data source=" & server.mappath("../wwwlink"))
dim cmd as new oledbcommand("select * from wwwlink",conn)
conn.open()
dim dr as new oledbdatareader=cmd.executereader()
mydatagrid.datasource=dr
mydatagrid.databind()
conn.close()
end sub
</script>
<html>
<body>
<form runat="server">
<asp:datagrid id="mydatagrid" headerstyle-backcolor="#FF0000" width="100%" runat="server"/>
</form>
</body>
</html>

______________________________________________________________________________
IE说:
Server Error in '/' Application.
--------------------------------------------------------------------------------

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30205: End of statement expected.

Source Error:

Line 6: dim cmd as new oledbcommand("select * from wwwlink",conn)
Line 7: conn.open()
Line 8: dim dr as new oledbdatareader=cmd.executereader()
Line 9: mydatagrid.datasource=dr
Line 10: mydatagrid.databind()

Source File: c:\inetpub\wwwroot\asp.net\chapter5\5-1.aspx Line: 8







[media=wmv,20,20,1]http://mv.ttmp3.com/605/BIGGER/BIGGER-16.rm[/media]

[此贴子已经被作者于2007-3-23 20:42:39编辑过]

1 回复
#2
tm_ma2007-03-24 09:02
dim conn as new oledbconnection("provider=microsoft.jet.oledb.4.0;data source=" & server.mappath("../wwwlink"))
忘记加后缀了........mdb
1