Issue Details (XML | Word | Printable)

Key: DNET-249
Type: Sub-task Sub-task
Status: Closed Closed
Resolution: Duplicate
Priority: Major Major
Assignee: Jiri Cincura
Reporter: Jiri Cincura
Votes: 2
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
.NET Data provider
DNET-247

FbCommand method private void UpdateParameterValues() issue

Created: 04/Jul/09 03:58 PM   Updated: 19/Feb/10 03:30 PM
Component/s: ADO.NET Provider
Affects Version/s: None
Fix Version/s: None


 Description  « Hide
class FbCommand
method private void UpdateParameterValues()
issue occurs when setting parameter value as byte[] for field with database type BLOB SUBTYPE TEXT
current source code accepts only string value
as a suggestion: replace
                                    blob.Write((string)this.Parameters[index].Value);
with something like this
                                    var valueType = this.Parameters[index].Value.GetType();
                                    if (valueType.IsArray && valueType.GetElementType() == typeof(byte))
                                    {
                                        blob.Write((byte[])this.Parameters[index].Value);
                                    }
                                    else
                                        blob.Write((string)this.Parameters[index].Value);

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Jiri Cincura added a comment - 18/Sep/09 01:38 AM

vinogradniy added a comment - 19/Feb/10 01:32 PM
After preparing the query parameter list is empty. What to do in this case?

Jiri Cincura added a comment - 19/Feb/10 03:30 PM
How is this related to this issue (did you noticed that it's closed)? Why should prepare do anything with parameters.