Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Inserting data with DbSet fails on some column types #143

Closed
satano opened this issue Jul 4, 2018 · 0 comments · Fixed by #145
Closed

Inserting data with DbSet fails on some column types #143

satano opened this issue Jul 4, 2018 · 0 comments · Fixed by #145

Comments

@satano
Copy link
Member

satano commented Jul 4, 2018

Breaking changes

ColumnSchema class had method SetParameterDbType, which set a data type for DbCommand parameter. This method was renamed to SetupParameter, because it is doing more than just setting data type. It should set Size, Precision and Scale as well.

Library name and version

  • Kros.KORM 3.7.x

Description

Inserting data with DbSet fails when table has some specific columns.

  • On SQL Server it is decimal column (at least).
  • On MS Access is is the long text colum.

Exception is thrown when IDbCommand.Prepare() is called. In both cases, the problem is, that command parameters does not have set every needed values: Size for text column and Precision and Scale for numeric column.

We do not support Precision and Scale in our database schema yet, so to fix this issue, we must support them.

Steps To Reproduce

  1. Have a table with column with affected data type.
  2. Add some data to the DbSet.
  3. Commit data (DbSet.CommitChanges()).

Expected behavior

Inserting data should just work.

Actual behavior

Exception is thrown.

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

Successfully merging a pull request may close this issue.

1 participant