M
Michael Morisoli
I am trying to find out if it is possable to store a bitmap into a sqlce
database.
I have created a test table with a few columns, one of which is an Image
type.
For the life of me I can not find a way to store the bitmap into the
database. Here is what I am doing that is raising InvalidCastException
errors.
try
string sql = "Insert Into Signatures (PackageGUID, SignedByEmployeeGUID,
Image) Values (?, ?, ?)";
SqlCeCommand cmd = GetCommand();
cmd.CommandText = sql;
cmd.Parameters.Add("@PackageGUID", PackageGUID);
cmd.Parameters.Add("@SignedByEmployeeGUID", SignedByEmployeeGUID);
cmd.Parameters.Add("@Image", SignatureBitmap);
count = cmd.ExecuteNonQuery();
}
catch (SqlCeException sqlex)
{
//retval = false;
HandleError(sqlex);
}
catch (Exception ex)
{
HandleError(ex);
}
finally
{
Close();
}
Thanks, Mike
database.
I have created a test table with a few columns, one of which is an Image
type.
For the life of me I can not find a way to store the bitmap into the
database. Here is what I am doing that is raising InvalidCastException
errors.
try
string sql = "Insert Into Signatures (PackageGUID, SignedByEmployeeGUID,
Image) Values (?, ?, ?)";
SqlCeCommand cmd = GetCommand();
cmd.CommandText = sql;
cmd.Parameters.Add("@PackageGUID", PackageGUID);
cmd.Parameters.Add("@SignedByEmployeeGUID", SignedByEmployeeGUID);
cmd.Parameters.Add("@Image", SignatureBitmap);
count = cmd.ExecuteNonQuery();
}
catch (SqlCeException sqlex)
{
//retval = false;
HandleError(sqlex);
}
catch (Exception ex)
{
HandleError(ex);
}
finally
{
Close();
}
Thanks, Mike