Click here to Skip to main content
15,885,856 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
Posted

1 solution

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
 
Share this answer
 
Comments
joyjhonson 6-Sep-12 7:00am    
Hey! santosh, thank you for responce, but why it is working for other colum whose type in access is long integer whereas int in SQL??? any other solution?
Santhosh Kumar Jayaraman 6-Sep-12 7:04am    
here your column length is 4..It will work fine till you have value less than or equal to 4 digits. But for this column you have a value with more than 4 digits, thats why. Check and let me know whether you have any value greater than 9999 in your access db column
joyjhonson 7-Sep-12 8:36am    
Hey! santosh,i checked,value for above newly added column is alwayes zero.
what else could be the reason?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900