LinuxDoku / migratordotnet

Automatically exported from code.google.com/p/migratordotnet
0 stars 0 forks source link

Inability to update a column via the Database.Update command unless column can be forced into a string. #86

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a Binary BLOB column (NHibernates default for
System.Color.Drawing as it serializes it into the BLOB)
2. Decide you want to change the default (we can argue about where system
settings should be stored later)
3. Try and update it via the Database.Update(string[], string[]) command

I've already modded and added a method for ExecuteNonQuery(string,
IDictionary) that take a query with named parameters and builds a
IDbCommand with the parameters pulled out of the IDictionary.  This lets
the IDbCommand implementation worry about how to insert the binary data.

Is there some easy way to force the binary into a string to use your Update
that I don't know about??  If not is there any plan to expose the
IDbConnection for usage if your precanned methods don't work, as this would
solve the problem as well?? If not, I can make a patch and add some tests
to submit my solution.

Original issue reported on code.google.com by garri...@gmail.com on 15 Jan 2009 at 7:30

GoogleCodeExporter commented 8 years ago
The proper fix for this is to stop doing string concatenation to add values and 
instead 
use parameterized queries and bind the values - as you allude to. I think that 
would be 
a good thing. The tricky part is separating the various parameter names (@foo, 
?, etc) 
for the different providers.

Original comment by geoffl...@gmail.com on 8 Mar 2009 at 2:51