I am new to programming in C#. I am trying to develop a C# application using Visual Studio 2005. I wish to do some validation on a field titled "formattedString" as follows.
I tried to check that the field is numeric. I also want to check that the field does not have a value of Zero. Do you know how to
perform this validation using my existing code? Thanks.
arr1[i, 11] = "GROUP_FIELD_NAME:CpcsNo";
String h = reader.ReadElementContentAsString();
String formattedString = h.Substring(9, 6);
Int64 intTest = 0;
if (Int64.TryParse(formattedString, out intTest))
Console.WriteLine("Item is numeric");
else
Console.WriteLine("Item is not numeric");
I tried to check that the field is numeric. I also want to check that the field does not have a value of Zero. Do you know how to
perform this validation using my existing code? Thanks.
arr1[i, 11] = "GROUP_FIELD_NAME:CpcsNo";
String h = reader.ReadElementContentAsString();
String formattedString = h.Substring(9, 6);
Int64 intTest = 0;
if (Int64.TryParse(formattedString, out intTest))
Console.WriteLine("Item is numeric");
else
Console.WriteLine("Item is not numeric");