来自数据源的字符串类型的给定值不能转换为指定列的实数类型 [英] The given value of type string from the data source can not be converted to type real of the specified column

查看:222
本文介绍了来自数据源的字符串类型的给定值不能转换为指定列的实数类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我在迁移表的所有行数据时遇到错误,因为"来自数据源的字符串类型的给定值无法转换为指定列的实数类型" )到另一个目标表(SQL表).
我正在使用WriteToServer(DataTable)函数来完成上述工作.
以前我们从未遇到过任何问题,最近我们在MS-access表中添加了一个名为" Value "的新列,还在SQL数据库中添加了同名的等效列.

MS-access中的值"列属性:
名称:值
类型:长整数
必填:否
索引:否

SQL中的值"列属性:

名称:值
类型:int,不为空
身份:假
长度:4

关于为什么我会收到此错误的任何想法吗?

是否由于Access中的Required属性而导致???
OR 是因为在SQL中为新添加的列分配了非null约束吗?

还是其他原因?

请帮忙.

问候,
Joy

Hi all,
I am getting error as "The given value of type string from the data source can not be converted to type real of the specified column" while migrating a all row data of table(MS-access) to another destination table( SQL table).
I am using WriteToServer(DataTable)function to do above job.
Earlier we never faced any issue,recently we added a new column in MS-access table named as "Value" also eqivalent column with the same name was added in SQL database also.

"Value" colum property in MS-access:
Name: Value
Type: long integer
Required: No
Indexed: No

"Value" colum property in SQL:

Name:Value
Type:int, not null
Identity: false
Length: 4

Any idea as to why i am getting this error???

Is it because of Required property in Access if No???
OR is it because of assigning not null constraint for newly added colum in SQL??

Or any other reason??

Please help.

Regards,
Joy

推荐答案

更改列的长度并使其尽可能长.您正在尝试将long保存为长度为4的整数列.

增加长度并更改列数据类型
Change the length of your column and make it as long as well. You are trying to save long into integer column of length 4.

Increase the length and change the column data type


这篇关于来自数据源的字符串类型的给定值不能转换为指定列的实数类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆