Problem with a code line - parameter.

  • 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
 
Miguel said:
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" />

Hi Miguel,

perhaps because local02Metro.Checked returns a Boolean and because it is
not possible to compare a Boolean like <>""?

Cheers

Arne Janning
 
Thanks,

i allready solved it.

Cheers,
Miguel

Arne Janning said:
Hi Miguel,

perhaps because local02Metro.Checked returns a Boolean and because it is
not possible to compare a Boolean like <>""?

Cheers

Arne Janning
 
Back
Top