C
Chris
I was thinking that these two methods should be inverses of each other,
but that doesn't appear to be consistently the case in MS code. Also,
I kind of think that Parse should not be case sensitive; 1e10 == 1E10.
For example:
try
{
on = OracleNumber.Parse("Null");
}
catch (Exception e)
{
Console.WriteLine(e.ToString()); // System.FormatException
}
try
{
s16 = SqlInt16.Parse("Null");
}
catch (Exception e)
{
Console.WriteLine(e.ToString()); // No exception; s16 =
SqlInt16.Null
}
try
{
s32 = SqlInt32.Parse("Null");
}
catch (Exception e)
{
Console.WriteLine(e.ToString()); // No exception; s32 =
SqlInt16.Null
}
try
{
s16 = SqlInt16.Parse("null");
}
catch (Exception e)
{
Console.WriteLine(e.ToString()); // {"Input string was not
in a correct format."}
}
try
{
s32 = SqlInt32.Parse("null");
}
catch (Exception e)
{
Console.WriteLine(e.ToString()); // No exception; s32 =
SqlInt16.Null
}
try
{
sdt = SqlDateTime.Parse("Null");
}
catch (Exception e)
{
Console.WriteLine(e.ToString()); // no exception
}
try
{
sdt = SqlDateTime.Parse("null");
}
catch (Exception e)
{
Console.WriteLine(e.ToString()); // {"String was not
recognized as a valid DateTime."}
}
// Why DateTime in the message? The type I'm parsing is an
SqlDateTime.
Anyone know if case-sensitivity is expected to change?
Same question for consistency between the OracleClient types (written
by MS) and the SqlClient types?
Anyone happen to know how the .Net provider written by Oracle behaves?
-Chris
but that doesn't appear to be consistently the case in MS code. Also,
I kind of think that Parse should not be case sensitive; 1e10 == 1E10.
For example:
try
{
on = OracleNumber.Parse("Null");
}
catch (Exception e)
{
Console.WriteLine(e.ToString()); // System.FormatException
}
try
{
s16 = SqlInt16.Parse("Null");
}
catch (Exception e)
{
Console.WriteLine(e.ToString()); // No exception; s16 =
SqlInt16.Null
}
try
{
s32 = SqlInt32.Parse("Null");
}
catch (Exception e)
{
Console.WriteLine(e.ToString()); // No exception; s32 =
SqlInt16.Null
}
try
{
s16 = SqlInt16.Parse("null");
}
catch (Exception e)
{
Console.WriteLine(e.ToString()); // {"Input string was not
in a correct format."}
}
try
{
s32 = SqlInt32.Parse("null");
}
catch (Exception e)
{
Console.WriteLine(e.ToString()); // No exception; s32 =
SqlInt16.Null
}
try
{
sdt = SqlDateTime.Parse("Null");
}
catch (Exception e)
{
Console.WriteLine(e.ToString()); // no exception
}
try
{
sdt = SqlDateTime.Parse("null");
}
catch (Exception e)
{
Console.WriteLine(e.ToString()); // {"String was not
recognized as a valid DateTime."}
}
// Why DateTime in the message? The type I'm parsing is an
SqlDateTime.
Anyone know if case-sensitivity is expected to change?
Same question for consistency between the OracleClient types (written
by MS) and the SqlClient types?
Anyone happen to know how the .Net provider written by Oracle behaves?
-Chris