Problem with Dataset for MS Access Yes/No Field

  • Thread starter Alexander Ovchinnikov
  • Start date
A

Alexander Ovchinnikov

Hello All!
I have some problem with Yes/No field in MS Access.
In WebService I create DataSet and return it client like next:

DataSet ds = new DataSet( );
daContentList = new OdbcDataAdapter( mysection.SelectRequest,
( string )ConfigurationSettings.AppSettings[ "ConnectionString" ]
);
OdbcCommandBuilder cbContentList = new OdbcCommandBuilder(
daContentList );
if( mysection.TableName.Equals( string.Empty ) ){
daContentList.FillSchema( ds, SchemaType.Source, sName );
daContentList.Fill( ds, sName );
}else{
daContentList.FillSchema( ds, SchemaType.Source, mysection.TableName
);
daContentList.Fill( ds, mysection.TableName );
}
ds.DataSetName = sName;
return ds;

The code worked perfectly but Schema is incorrect in some places for
example for all xs:string, xs:int alements schema allowed
minOccurs="0" and for all bit fields xs:boolean minOccurs="1". This
behaviour is incorrect cause I have some mondatory Text fields and all
bit fields are optional
What's wrong with my schema for dataset?
Thanks Alex
 
M

Mary Chipman

The problem is that Access Yes/No fields aren't true booleans, so you
fall into the pit of three-value logic -- a non-required field of
Yes/No data type can return a value of true (-1), false (0), or
unknown (null). One solution is to adjust the columns in the table to
not allow nulls and supply a default value of either true or false,
eliminating the possibility of nulls popping up.

--Mary
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top