The forum will be down for scheduled maintenance on Saturday, March 4 beginning at 10am EST. Actual downtime is unknown but may be several hours.

I'm using

iAnywhere.Data.SQLAnywhere.v4.5, runtime version: v4.0.30319, Version 12.0.1.38734 VisualStudio 2012

When adding a column via Entity Framework:

AddColumn("TableName", "ColumnName", c => c.Boolean(nullable:true));

or

AddColumn("TableName", "ColumnName", c => c.Boolean());

This has a result that a column is created with Type of BIT in the remote client, BUT Unfortunately, the column is not nullable.

This approach DOES work for other types like integer.


Workaround 1. perform following query:

ALTER TABLE TableName ALTER ColumnName NULL

This only works when the table has no data. if it already has data => exception => "Table must be empty"


Workaround 2.

use regular sql instead of EF commands:

alter table TableName add ColumnName bit NULL;

Where do I report this? Anyone seen anything like this before?

asked 18 Jun '15, 02:08

vdcey's gravatar image

vdcey
619212736
accept rate: 33%

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×405
×65
×45

question asked: 18 Jun '15, 02:08

question was seen: 1,306 times

last updated: 18 Jun '15, 02:08