468,315 Members | 1,500 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,315 developers. It's quick & easy.

How to turn Strict "off"?

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.ex e" /t:library /utf8output /R:"c:\winnt\assembly\gac\system\1.0.5000.0__b77a5c 561934e089\system.dll"/R:"c:\winnt\assembly\gac\system.web.services\1.0.5 000.0__b03f5f7f11d50a3a\system.web.services.dll" /R:"c:\winnt\assembly\gac\system.xml\1.0.5000.0__b7 7a5c561934e089\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.500 0.0__b03f5f7f11d50a3a\system.web.mobile.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temp orary asp.net files\uniprowebapplication1\03182950\6e42cb10\asse mbly\dl2\0323ba7e\207b2def_2547c301\uniprodatatier 1.dll" /R:"c:\winnt\assembly\gac\system.data\1.0.5000.0__b 77a5c561934e089\system..data.dll" /R:"c:\winnt\assembly\gac\system.enterpriseservices \1.0.5000.0__b03f5f7f11d50a3a\system.enterpriseser vices.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temp orary asp.net files\uniprowebapplication1\03182950\6e42cb10\asse mbly\dl2\13199096\b026eaf0_2547c301\uniprowebappli cation1.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temp orary asp.net files\uniprowebapplication1\03182950\6e42cb10\n-6ek_3q.dll" /R:"c:\winnt\assembly\gac\system.web\1.0.5000.0__b0 3f5f7f11d50a3a\system.web.dll" /out:"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Te mporary ASP.NET Files\uniprowebapplication1\03182950\6e42cb10\3uim ztuq.dll" /D:DEBUG=1 /debug+ /win32resource:"C:\WINNT\Microsoft.NET\Framework\v1 .1.4322\Temporary ASP.NET Files\uniprowebapplication1\03182950\6e42cb10\3uim ztuq.res" "C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Tempor ary ASP.NET Files\uniprowebapplication1\03182950\6e42cb10\3uim ztuq.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\frmCustomer Select.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\frmCustomer Select.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
ac***@bellsouth.net

Nov 17 '05 #1
1 6328
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" %>

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Author: ADO.NET and XML: ASP.NET on the Edge

************************************************** ******************************
Think Outside the Box!
************************************************** ******************************
"Andy Crawford" <ac***@bellsouth.net> wrote in message news:ph***************@fe03.atl2.webusenet.com...
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.ex e" /t:library /utf8output /R:"c:\winnt\assembly\gac\system\1.0.5000.0__b77a5c 561934e089\system.dll"/R:"c:\winnt\assembly\gac\system.web.services\1.0.5 000.0__b03f5f7f11d50a3a\system.web.services.dll" /R:"c:\winnt\assembly\gac\system.xml\1.0.5000.0__b7 7a5c561934e089\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.500 0.0__b03f5f7f11d50a3a\system.web.mobile.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temp orary asp.net files\uniprowebapplication1\03182950\6e42cb10\asse mbly\dl2\0323ba7e\207b2def_2547c301\uniprodatatier 1.dll" /R:"c:\winnt\assembly\gac\system.data\1.0.5000.0__b 77a5c561934e089\system..data.dll" /R:"c:\winnt\assembly\gac\system.enterpriseservices \1.0.5000.0__b03f5f7f11d50a3a\system.enterpriseser vices.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temp orary asp.net files\uniprowebapplication1\03182950\6e42cb10\asse mbly\dl2\13199096\b026eaf0_2547c301\uniprowebappli cation1.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temp orary asp.net files\uniprowebapplication1\03182950\6e42cb10\n-6ek_3q.dll" /R:"c:\winnt\assembly\gac\system.web\1.0.5000.0__b0 3f5f7f11d50a3a\system.web.dll" /out:"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Te mporary ASP.NET Files\uniprowebapplication1\03182950\6e42cb10\3uim ztuq.dll" /D:DEBUG=1 /debug+ /win32resource:"C:\WINNT\Microsoft.NET\Framework\v1 .1.4322\Temporary ASP.NET Files\uniprowebapplication1\03182950\6e42cb10\3uim ztuq.res" "C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Tempor ary ASP.NET Files\uniprowebapplication1\03182950\6e42cb10\3uim ztuq.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\frmCustomer Select.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\frmCustomer Select.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
ac***@bellsouth.net

Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by n_o_s_p_a__m | last post: by
2 posts views Thread by Mary Kerrigan | last post: by
reply views Thread by wurlds_wurst_coder | last post: by
reply views Thread by Jerry | last post: by
2 posts views Thread by pedestrian via SQLMonster.com | last post: by
4 posts views Thread by PH.D.Condidater.Li.Ning | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.