111,131
社区成员
发帖
与我相关
我的任务
分享
strSql = "update sc生产制单_报表_款印绣辅图 set 列" + m.ToString() + "=@image where 生产制单号='" + a生产制单.编号 + "' ";
SqlCommand com2 = new SqlCommand(strSql, clsSql.cn);
SqlParameter sp2 = new SqlParameter("@image", SqlDbType.Image);
try
{
Stream ms2 = File.Open(strr列值, FileMode.Open, FileAccess.Read);
byte[] b2 = new byte[ms2.Length];
ms2.Read(b2, 0, b2.Length);
sp2.Value = b2;
com2.Parameters.Add(sp2);
try
{
com2.ExecuteNonQuery();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
ms2.Dispose();
com2.Dispose();
}
catch (Exception)
{
MessageBox.Show("图片被另一个进程使用. 路径:" + strr列值.Trim());
continue;
}