How to turn Strict "off"?

A

Andy Crawford

Even though I have set Strict Off, it is still on, thus causing this error.


Here is the code in a templated Column of a DataGrid: (XPpro, Framework 1.1)

<ItemTemplate>
<TABLE width="100%">
<TR>
<TD class="gridItemStyleNormal" align="left" width="50%"><%# Databinder.Eval(Container.DataItem, "CustomerName") %></TD>
<TD class="gridItemStyleNormal" align="left" width="30%"><%# Databinder.Eval(Container.DataItem, "BusinessCategoryDesc") %></TD>
<TD class="gridItemStyleNormal" align="left" width="20%"><%# Databinder.Eval(Container.DataItem, "NameFirst") + " " + Databinder.Eval(Container.DataItem, "NameLast") %></TD>
</TR>
</TABLE>
</ItemTemplate>

--------------------------------------------------------------------------------
The error message says:

C:\winnt\system32> "c:\winnt\microsoft.net\framework\v1.1.4322\vbc.exe" /t:library /utf8output /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\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll" /R:"c:\winnt\assembly\gac\system.web.mobile\1.0.5000.0__b03f5f7f11d50a3a\system.web.mobile.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net files\uniprowebapplication1\03182950\6e42cb10\assembly\dl2\0323ba7e\207b2def_2547c301\uniprodatatier1.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" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net files\uniprowebapplication1\03182950\6e42cb10\assembly\dl2\13199096\b026eaf0_2547c301\uniprowebapplication1.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net files\uniprowebapplication1\03182950\6e42cb10\n-6ek_3q.dll" /R:"c:\winnt\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll" /out:"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\uniprowebapplication1\03182950\6e42cb10\3uimztuq.dll" /D:DEBUG=1 /debug+ /win32resource:"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\uniprowebapplication1\03182950\6e42cb10\3uimztuq.res" "C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\uniprowebapplication1\03182950\6e42cb10\3uimztuq.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:\Documents and Settings\AWC\My Documents\UniPro\UniproWebApplication1\frmCustomerSelect.aspx(60) : error BC30038: Option Strict On prohibits operands of type Object for operator '+'.

target.SetDataBoundString(2, System.Convert.ToString(Databinder.Eval(Container.DataItem, "NameFirst") + Databinder.Eval(Container.DataItem, "NameLast")))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\Documents and Settings\AWC\My Documents\UniPro\UniproWebApplication1\frmCustomerSelect.aspx(60) : error BC30038: Option Strict On prohibits operands of type Object for operator '+'.

target.SetDataBoundString(2, System.Convert.ToString(Databinder.Eval(Container.DataItem, "NameFirst") + Databinder.Eval(Container.DataItem, "NameLast")))
-------------------------------------------------------------------------------------------------------------------------------------------------------------------

When you look at the compiled part is shows Strick On.


Line 1: '------------------------------------------------------------------------------
Line 2: ' <autogenerated>
Line 3: ' This code was generated by a tool.
Line 4: ' Runtime Version: 1.1.4322.573
Line 5: '
Line 6: ' Changes to this file may cause incorrect behavior and will be lost if
Line 7: ' the code is regenerated.
Line 8: ' </autogenerated>
Line 9: '------------------------------------------------------------------------------
Line 10:
Line 11: Option Strict On
Line 12: Option Explicit On
Line 13:
Line 14: Imports ASP
Line 15: Imports Microsoft.VisualBasic
Line 16: Imports System


I have replaced "Strick On" with "Strict Off" in all projects, but it still thinks it's on. I also changed the Build options for each project.

Where is it getting set ON???? I even set Explicit Off, but it didn't change either.

Thanks,
Andy
(e-mail address removed)
 
C

Cowboy \(Gregory A. Beamer\)

You may not have strict really off. YOu need to check the project file and make sure it is set to off there, as well, as Strict can be set on a project basis. Also, check the @ directive in the page. It may be something like:

<%@ Page language="VB" CodeBehind="ThisPage.aspx.vb" strict="on" %>


Even though I have set Strict Off, it is still on, thus causing this error.


Here is the code in a templated Column of a DataGrid: (XPpro, Framework 1.1)

<ItemTemplate>
<TABLE width="100%">
<TR>
<TD class="gridItemStyleNormal" align="left" width="50%"><%# Databinder.Eval(Container.DataItem, "CustomerName") %></TD>
<TD class="gridItemStyleNormal" align="left" width="30%"><%# Databinder.Eval(Container.DataItem, "BusinessCategoryDesc") %></TD>
<TD class="gridItemStyleNormal" align="left" width="20%"><%# Databinder.Eval(Container.DataItem, "NameFirst") + " " + Databinder.Eval(Container.DataItem, "NameLast") %></TD>
</TR>
</TABLE>
</ItemTemplate>

--------------------------------------------------------------------------------
The error message says:

C:\winnt\system32> "c:\winnt\microsoft.net\framework\v1.1.4322\vbc.exe" /t:library /utf8output /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\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll" /R:"c:\winnt\assembly\gac\system.web.mobile\1.0.5000.0__b03f5f7f11d50a3a\system.web.mobile.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net files\uniprowebapplication1\03182950\6e42cb10\assembly\dl2\0323ba7e\207b2def_2547c301\uniprodatatier1.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" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net files\uniprowebapplication1\03182950\6e42cb10\assembly\dl2\13199096\b026eaf0_2547c301\uniprowebapplication1.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net files\uniprowebapplication1\03182950\6e42cb10\n-6ek_3q.dll" /R:"c:\winnt\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll" /out:"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\uniprowebapplication1\03182950\6e42cb10\3uimztuq.dll" /D:DEBUG=1 /debug+ /win32resource:"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\uniprowebapplication1\03182950\6e42cb10\3uimztuq.res" "C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\uniprowebapplication1\03182950\6e42cb10\3uimztuq.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:\Documents and Settings\AWC\My Documents\UniPro\UniproWebApplication1\frmCustomerSelect.aspx(60) : error BC30038: Option Strict On prohibits operands of type Object for operator '+'.

target.SetDataBoundString(2, System.Convert.ToString(Databinder.Eval(Container.DataItem, "NameFirst") + Databinder.Eval(Container.DataItem, "NameLast")))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\Documents and Settings\AWC\My Documents\UniPro\UniproWebApplication1\frmCustomerSelect.aspx(60) : error BC30038: Option Strict On prohibits operands of type Object for operator '+'.

target.SetDataBoundString(2, System.Convert.ToString(Databinder.Eval(Container.DataItem, "NameFirst") + Databinder.Eval(Container.DataItem, "NameLast")))
-------------------------------------------------------------------------------------------------------------------------------------------------------------------

When you look at the compiled part is shows Strick On.


Line 1: '------------------------------------------------------------------------------
Line 2: ' <autogenerated>
Line 3: ' This code was generated by a tool.
Line 4: ' Runtime Version: 1.1.4322.573
Line 5: '
Line 6: ' Changes to this file may cause incorrect behavior and will be lost if
Line 7: ' the code is regenerated.
Line 8: ' </autogenerated>
Line 9: '------------------------------------------------------------------------------
Line 10:
Line 11: Option Strict On
Line 12: Option Explicit On
Line 13:
Line 14: Imports ASP
Line 15: Imports Microsoft.VisualBasic
Line 16: Imports System


I have replaced "Strick On" with "Strict Off" in all projects, but it still thinks it's on. I also changed the Build options for each project.

Where is it getting set ON???? I even set Explicit Off, but it didn't change either.

Thanks,
Andy
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top