0
(click on this box to dismiss)
ADO.NET return error "Don't know how to write the parameter!"
Hi, I am trying to insert a image into the database, my database is type BLOB and in C# is type byte[].
When I try to do the insert the error is: Don't know how to write the parameter!
Whats is wrong? how can I get a more technical description error from database.
Why has error with BLOB type?
1
1
Hi.
Here is a quick example of how to insert BLOB data:
And you can find more examples of dealing with BLOB data types in the driver test cases suite - see the source code of the driver.
If you still have issues, then please share a little bit more:
- what is your code
- what exactly is not working as expected in your setup?
- what are you trying to achieve
etc.
Obviously, the most important help would be to share your code, if possible.
Thank you!
Here is a quick example of how to insert BLOB data:
byte[] bytes = new byte[...]; ... Blob.setBytes(1, bytes); CUBRIDParameter param = new CUBRIDParameter(); param.ParameterName = "?p"; param.Value = Blob; cmd.Parameters.Add(param); cmd.Parameters[0].DbType = DbType.Binary; cmd.ExecuteNonQuery(); ...
And you can find more examples of dealing with BLOB data types in the driver test cases suite - see the source code of the driver.
If you still have issues, then please share a little bit more:
- what is your code
- what exactly is not working as expected in your setup?
- what are you trying to achieve
etc.
Obviously, the most important help would be to share your code, if possible.
Thank you!
질문시간 작년
viewed 494 times