title: Conversion from string "valor" to type 'Integer' is not valid in VB.NET
body: <p>I'm a C# programmer but now I have to code VB.NET and I having a situation trying to translate this line of C# code to VB.NET</p>
  
  <p>what I want is to check if the value that I obtained via MySQLDataReader is DBNull, in C# I use this to check if a string value is null or not</p>
  
  <pre><code>data.empName = dr.IsDBNull(1) ? "No name !!!" : dr.GetString(1).ToString();
  </code></pre>
  
  <p>But now I need the same verification but in VB.NET and also the data type retrieved via MySQLDataReader is decimal, this is what I got for the time beign</p>
  
  <pre><code>IIf(dr.IsDBNull("valor"), 0.0, dr.GetDecimal(dr.GetOrdinal("valor")))
  </code></pre>
  
  <p>but when I debug the app got the error message:</p>
  
  <p>An exception of type 'System.InvalidCastException' occurred in Microsoft.VisualBasic.dll but was not handled in user code</p>
  
  <p>Additional information: Conversion from string "valor" to type 'Integer' is not valid.</p>
  
  <p>the data type in the MySQL table is Decimal(10,2), could you please help me and tell me what am I doing wrong</p>