Page 1 of 1

Error querying/updating 'tinyint' fields in SQL Server Compact

Posted: Wed 19 Mar 2014 22:15
by jeremyw
I just found what I'm guessing is yet another conflict resulting from trying to query or update a specific field type (tinyint) using parameterized SQL.

The following code is sufficient to cause an issue:

Code: Select all

Command->SQL->Text = "INSERT [TableName] ( [TinyIntField] ) VALUES ( :TinyIntValue )";
Command->Params->Items[0]->Value = 1;
Command->Execute();
I get the same exception error message I've seen previously in similar situations:
Requested conversion is not supported. [,,,,,]
I've also explored other alternatives, introducing different combinations of the following code, but with the same result:

Code: Select all

Command->Params->Items[0]->DataType = ftByte;
Command->Params->Items[0]->AsByte = 1;
Command->Params->Items[0]->AsInteger = 1;
Note that I only see this error with SQL Server Compact, not in SQL Server.

My development environment consists of:
• Windows 7 (64-bit)
• RAD Studio 2010
• MS SQL Server Compact 3.5
• MS SQL Server Express 2008 R2
• SDAC 6.9.17

Here are some of earlier posts where I reported similar issues:
http://forums.devart.com/viewtopic.php?f=6&t=24873
http://forums.devart.com/viewtopic.php?f=6&t=21172

Re: Error querying/updating 'tinyint' fields in SQL Server Compact

Posted: Thu 20 Mar 2014 11:18
by AlexP
Hello,

Thank you for the information. We have reproduced the problem in SQL Server Compact and will investigate the reasons of such behavior.

Re: Error querying/updating 'tinyint' fields in SQL Server Compact

Posted: Thu 20 Mar 2014 15:31
by jeremyw
Thank you as usual for the prompt response.

Also, given the fact that I've encountered similar issues with parameterized SQL and certain SQL Server Compact data types, it might be worthwhile to conduct a more thorough investigation.

Re: Error querying/updating 'tinyint' fields in SQL Server Compact

Posted: Mon 24 Mar 2014 13:00
by AlexP
Thank you for the information. We will check all the supported types in MS SQL Server Compact and MS SQL Server Express before the next release.

Re: Error querying/updating 'tinyint' fields in SQL Server Compact

Posted: Tue 20 May 2014 17:44
by jeremyw
From the latest release notes (SDAC version 6.10), it looks like this might have been fixed. I just wanted to confirm this before renewing our support plan.

Re: Error querying/updating 'tinyint' fields in SQL Server Compact

Posted: Thu 22 May 2014 14:15
by azyk
Hi,

In the current SDAC release, work with the tinyint data type was fixed for SQL Server Compact.