Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't write empty values into numeric fields #40

Open
Plavozont opened this issue May 17, 2022 · 1 comment
Open

Can't write empty values into numeric fields #40

Plavozont opened this issue May 17, 2022 · 1 comment

Comments

@Plavozont
Copy link

Hello, sorry, maybe I am missing something obvious, but I can't write null values into numeric fields, all null values become zeroes in the end file. I create Object[] rowObjects = new Object[field.Count]; (which is not documented in a quick start some how)
Fill it like this
rowObjects[i] = ((field_value==DBNull.Value) ? null : field_value);
Or like this
rowObjects[i] = field_value;
Then
writer.AddRecord(rowObjects);
Then
writer.Write(fos);
In both cases I get zeroes, please help.

@Plavozont Plavozont changed the title Can't write empty value into numeric fields Can't write empty values into numeric fields May 17, 2022
@UsernameNotFoundException

This is expected behavior:
Null Values

The new DBF7 (dBASE) table type support nulls, as do most other tables, including DB (Paradox). Older DBF formats do not. (emphasis added)

The ability to store nulls was not introduced into dBASE. dBASE PLUS 7 has it, but these are not the same product.

Additional Context

... DBFs only have the concept of an "empty" value, which is usually a common value that fields normally contain. For example, 0 is the "empty" value for a DBF table, but 0 is often a legitimate value a numeric field can contain and is thus not suitable to be treated as a true NULL value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants