NpgsqlConnection conn = new NpgsqlConnection(Settings.ConnectionString);
conn.Open();
NpgsqlCommand command = new NpgsqlCommand("select def_id from datatable where definition_id='00026b41-11e5-4557-823c-376a17e8253f'", conn);
Int16 _data = (Int16)command.ExecuteScalar();
This works in SQL, but not in the Code.
I got the System.NullReferenceException. I use npgsql btw. The selected Column has the smallInt format. The other guid. When I reverse selection and try to read the other table and change datatype to guid same error
both works in SQL