I have written a little bit of code, but while trying to add a date with "null" as a resultset from a database, I get an error, that null is not date / time.
So it seems, I have an error with the following code snippet... My question is: how to set the datatype correctly, that a "null" dataset would not create an error?
As you can see, first of all I make a difference between some datatypes to create the right objects. But in this one case, for the date, I want to allow null objects.
Could you please help me?
case kdType.Numeric20:
nKSI = ktSI.CreateKeyword(Int32.Parse(""+row[column]));
break;
case kdType.AlphaNumeric:
nKSI = ktSI.CreateKeyword(""+row[column]);
break;
case kdType.Date:
nKSI = ktSI.CreateKeyword(DateTime.ParseExact(""+row[column], "dd.MM.yyyy HH:mm:ss", null));
break;
case kdType.Currency:
nKSI = ktSI.CreateKeyword(Convert.ToDecimal(float.Parse(""+row[column], CultureInfo.CurrentCulture.NumberFormat)));
break;
case kdType.SpecificCurrency:
nKSI = ktSI.CreateKeyword(Convert.ToDecimal(float.Parse(""+row[column], CultureInfo.CurrentCulture.NumberFormat)));
break;