FbCommand   method private void UpdateParameterValues()   issue
---------------------------------------------------------------

                 Key: DNET-249
                 URL: http://tracker.firebirdsql.org/browse/DNET-249
             Project: .NET Data provider
          Issue Type: Sub-task
          Components: ADO.NET Provider
            Reporter: Jiri Cincura
            Assignee: Jiri Cincura


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);

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to