新手的问题

mao5000 2003-09-13 12:37:01
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: BC30188: Declaration expected.

Source Error:



Line 2: Dim conn AS SQLConnection
Line 3: Dim connstr As String
Line 4: connstr= "Server=192.168.0.92;DataBase=ancc; Pwd=sa000;Uid=sa"
Line 5: conn= New SQLConnection(connstr)
Line 6: </script>


Source File: D:\asp.net\inc\conn_ancc.aspx Line: 4



Show Detailed Compiler Output:


C:\WINNT\system32> "c:\winnt\microsoft.net\framework\v1.1.4322\vbc.exe" /t:library /utf8output /R:"c:\winnt\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll" /R:"c:\winnt\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll" /R:"c:\winnt\assembly\gac\system.web.services\1.0.5000.0__b03f5f7f11d50a3a\system.web.services.dll" /R:"c:\winnt\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e089\system.xml.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net files\root\97133c11\b0223498\assembly\dl2\dde15ed6\008c33d5_3828c201\dreamweaverctrls.dll" /R:"c:\winnt\assembly\gac\system.web.mobile\1.0.5000.0__b03f5f7f11d50a3a\system.web.mobile.dll" /R:"c:\winnt\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll" /R:"c:\winnt\assembly\gac\system.data\1.0.5000.0__b77a5c561934e089\system.data.dll" /R:"c:\winnt\assembly\gac\system.enterpriseservices\1.0.5000.0__b03f5f7f11d50a3a\system.enterpriseservices.dll" /out:"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\root\97133c11\b0223498\p3rga5ry.dll" /debug- "C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\root\97133c11\b0223498\p3rga5ry.0.vb"


Microsoft (R) Visual Basic .NET Compiler version 7.10.3052.4
for Microsoft (R) .NET Framework version 1.1.4322.573
Copyright (C) Microsoft Corporation 1987-2002. All rights reserved.

D:\asp.net\inc\conn_ancc.aspx(4) : error BC30188: Declaration expected.

connstr= "Server=192.168.0.92;DataBase=ancc; Pwd=sa000;Uid=sa"
~~~~~~~
D:\asp.net\inc\conn_ancc.aspx(5) : error BC30188: Declaration expected.

conn= New SQLConnection(connstr)


这样报错什么意思啊???
connstr就是我定义的一个字符串阿
...全文
31 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
cnhgj 2003-09-13
  • 打赏
  • 举报
回复
Import NameSpace="System.Data.SqlClient"
孟子E章 2003-09-13
  • 打赏
  • 举报
回复
Try:
Dim connstr As System.String

应该没有问题

62,025

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧