Closed bubibubi closed 7 years ago
This code should work to determine if a column is nullable. Check also EFCore.Jet for more info.
private static bool GetIsNullable(IDbConnection connection, DataRow rowColumn) { DataRow fieldRow = GetFieldRow(connection, (string)rowColumn["TABLE_NAME"], (string)rowColumn["COLUMN_NAME"]); if (fieldRow == null) return Convert.ToBoolean(rowColumn["IS_NULLABLE"]); return (bool) fieldRow["AllowDBNull"] && Convert.ToBoolean(rowColumn["IS_NULLABLE"]); }
This code should work to determine if a column is nullable. Check also EFCore.Jet for more info.