Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register


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?

link comment (0)
asked 2 years ago
castle79
60
4 Answers
1
Hi.

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!
link comment (0)
answered 2 years ago
contrib
11
tagged




You are either using a very old browser or a browser that is not supported.
In order to browse cubrid.org you need to have one of the following browsers:



Internet Explorer: Mozilla Firefox: Google Chrome: