Home

How to handle Bit fields in Postgres

Hi, so I have a Postgres DB with tables with columns defined as 'bit' datatype. LinqPad is choking on those fields and is giving me this error:

Cannot convert value 'True: System.Boolean' to type 'System.Collections.BitArray'

Not sure how to get LinqPad to handle this datatype. Any suggestions?

Stack trace:
at LinqToDB.Common.ConvertBuilder.ConvertDefault(Object value, Type conversionType)
at lambda_method137(Closure, DbDataReader)
at LinqToDB.Expressions.ConvertFromDataReaderExpression.ColumnReader.GetValue(DbDataReader dataReader)
at lambda_method119(Closure, IQueryRunner, DbDataReader)
at LinqToDB.Linq.QueryRunner.Mapper1.ReMapOnException(IDataContext context, IQueryRunner queryRunner, DbDataReader dataReader, ReaderMapperInfo& mapperInfo, Exception ex) at LinqToDB.Linq.QueryRunner.ExecuteQuery[T](Query query, IDataContext dataContext, Mapper1 mapper, Expression expression, Object[] ps, Object[] preambles, Int32 queryNumber)+MoveNext()
at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable1 source, Boolean& found) at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source)
at LinqToDB.Linq.Builder.FirstSingleBuilder.FirstSingleContext.<>c__DisplayClass5_01.<GetFirstOrDefaultElement>b__0(IDataContext db, Expression expr, Object[] ps, Object[] preambles) at LinqToDB.Linq.ExpressionQuery1.System.Linq.IQueryProvider.Execute[TResult](Expression expression)
at UserQuery.Main(), line 4

Sign In or Register to comment.