-1
下面这行代码在aspx代码在本地机器上的IIS下运行时出现上述错误。BC30201:预期表达式
Details = If(.GetString(2) = "", "", "<div><b>" & .GetString(2) & "</b></div>")
完全相同的代码运行,而无需在生产Web服务器上的错误。 我刚刚接管了这个网站,我还没有遇到过这种类型的If语句。
下面是preceeds以上其产生BC30201错误的语句的代码。
' Execute SQL procedure to fetch performance details
With New SQLCommand("FetchPerformance1", New SQLConnection(ConfigurationManager.ConnectionStrings("C1").ConnectionString))
.Parameters.AddWithValue("@Performance", Code)
.Parameters.AddWithValue("@Filters", Convert.ToByte(Mid(Query, 24, 1), 16))
.CommandType = StoredProcedure : .Connection.Open
With .ExecuteReader(CloseConnection)
' If performance not found ...
If Not .Read
' Display message page:
' Terminate script:
.Close : Response.End
End If
' Construct performance details string:
If .GetInt32(0) > 0 Then Links = "<a href=""view3.aspx" & Left(Query, 24) & Hex(.GetInt32(0)) & """ style=""float: left""><<</a>"
If .GetInt32(1) > 0 Then Links &= "<a href=""view3.aspx" & Left(Query, 24) & Hex(.GetInt32(1)) & """ style=""float: right"">>></a>"
你得到哪个错误? 语法看起来很奇怪。点运算符('.')表示您正在访问对象的方法,但点之前没有任何东西。此外,如果意味着应该在'true'和'false'之间做出决定,并且这里没有这样的事情。 –
BC30201:期望的表达式是我得到的错误。点运算符(。)引用记录的第三个字段。我的第二个问题是我没有完全理解if语句试图达到什么目的。 – DZS50
我认为我们需要的不仅仅是一条线。给我们一些代码。我们还在看哪种语言? –