Error with a code line. Urgent. Thank You.

  • Thread starter Thread starter Miguel Dias Moura
  • Start date Start date
M

Miguel Dias Moura

Hello,

i am inserting form values into a database and i am getting problems in this
line:

<Parameter Name="@Local02Metro" Value='<%# IIf(local02Metro.Checked <>
"", local02Metro.Checked, "") %>' Type="WChar" />

The error i get is this:

System.InvalidCastException: Cast from string "" to type 'Boolean' is not
valid. ---> System.FormatException: Input string was not in a correct
format.
at Microsoft.VisualBasic.CompilerServices.DoubleType.Parse(String Value,
NumberFormatInfo NumberFormat)
at Microsoft.VisualBasic.CompilerServices.BooleanType.FromString(String
Value)

Can you tell me what i need to change in my line?
Basicly i am getting the value of a check box.

I am working in ASP.net / VB.

Thank You,
Miguel
 
local02Metro.Checked will return a 1 or a 0

it won't compare to ""

try changing code to local02Metro.Checked =0
 
Back
Top