How to turn Strict "off"?

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default 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
    [email]ac411@bellsouth.net[/email]



    Andy Crawford Guest

  2. Similar Questions and Discussions

    1. How to "turn off" form functions...
      Hi all! I created a form. People filled it out. Now I need to collect all the filled-out pdfs and put them into one, final document. Is there a way...
    2. WORD bullet points turn into "??"
      Can anyone please advise why when I use the quick option to make Acrobat documents (ie use PDFWriter instead of distiller) from a WORD document I end...
    3. Is there a setting to allow $var = "" when POST and GET vars are strict?
      I have the following problem: $_POST and $_GET variables can only be used when in the correct format (not $val), but when I define a variable...
    4. how to "bless" while "strict"?
      -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm working through perlboot right now and have run up against a minor challenge. Unlike the...
    5. Q: "my" variables and "no strict 'refs'"
      The bottom of p.594 in the Camel book (3rd edition) says this: no strict 'refs'; $name = "variable"; $$name = 7 ; # Sets $variable to 7 ...
  3. #2

    Default Re: How to turn Strict "off"?

    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" <ac411@bellsouth.net> wrote in message news:phlPa.337$x%5.210@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
    [email]ac411@bellsouth.net[/email]



    Cowboy \(Gregory A. Beamer\) Guest

  4. #3

    Default Re: How to turn Strict "off"?

    I don't want to turn off the Strict or Explicit. Can you suggest a
    better way to concatenate two fields in a templated column?



    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Andrew Crawford Guest

  5. #4

    Default Re: How to turn Strict "off"?

    You need to cast the values as strings.

    --
    HTH,

    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    [url]http://www.takempis.com[/url]
    Big things are made up
    of lots of little things

    "Andrew Crawford" <ac411@bellsouth.net> wrote in message
    news:eSMiZ5ISDHA.1924@TK2MSFTNGP12.phx.gbl...
    > I don't want to turn off the Strict or Explicit. Can you suggest a
    > better way to concatenate two fields in a templated column?
    >
    >
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Kevin Spencer Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139