private void btnSave_Click(object sender, EventArgs e)
{
FileStream fs = File.OpenRead(txtFileName.Text);
byte[] imageb = new byte[fs.Length];
fs.Read(imageb, 0, imageb.Length);
fs.Close();
string ls_emp_code = txtEmpCode.Text.Trim();
string ls_filepath = txtFileName.Text.Trim();
//更新一个字段
//var result = SqlSugarHelper.SqlSugarClient.Updateable<t_emp_fp>().SetColumns("face_pic", imageb).Where("emp_code='" + ls_emp_code + "'").ExecuteCommand();
//更新多个字段
var result = SqlSugarHelper.SqlSugarClient.Updateable<t_emp_fp>().SetColumns(p=>new t_emp_fp { face_pic = imageb, filepath = ls_filepath }).Where("emp_code='" + ls_emp_code + "'").ExecuteCommand();
if (result <= 0)
{
MessageBox.Show("更新相片到數據庫有問題", "提示");
return;
}