目前被另一个用户

目前被另一个用户

本文介绍了无法保存;目前被另一个用户OLEDB锁定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

这是我的代码:

hi all
this is my code:

try
            {
                byte[] imageData = ReadFile(txt_image.Text);
                if (masked_txt_codem.MaskCompleted == false && txt_image.Text ==string.Empty)
                {
                    errorProvider1.SetError(masked_txt_codem, "please ");
                    errorProvider1.SetError(txt_image, "please");
                }
                else
                {
                    errorProvider1.Clear();
                    OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + strcon);
                    con.Open();
                    OleDbCommand comm = new OleDbCommand();
                    comm.Connection = con;
                    comm.CommandType = CommandType.Text;

                   comm.CommandText = "UPDATE janbaz set fname='" + txt_name.Text + "' ,lname ='" + txt_famili.Text + "' ,father_name='" + txt_father.Text + "',birth_date='" + masked_birth_date.Text + "',tahsilat='" + txt_tahsilat.Text + "' ,codem='" + masked_txt_codem.Text + "' , codesh='" + txt_codeshean.Text + "' ,place_tavalod='" + txt_address_work.Text +<big> "' ,[image] = @image</big> where codem='" + masked_txt_codem.Text + "'";

                    comm.Parameters.Add(new OleDbParameter("@image", (object)imageData));

                    MessageBox.Show("success");
                    comm.ExecuteNonQuery();
                    con.Close();
                    comm.Dispose();
                }
            }
            catch (ArgumentException)
            {
                errorProvider1.SetError(txt_image, "prob");
            }

当我想要更新图片

i面临以下错误:



可以不救;目前被另一个用户锁定

这个错误来自comm.ExecuteNonQuery();

i use access 2007 and c#.net 3.5(2008 )

when i want update image
i face the following error:

"Could not save; currently locked by another user"
and this error coming from comm.ExecuteNonQuery();
i use access 2007 and c#.net 3.5(2008)

推荐答案


这篇关于无法保存;目前被另一个用户OLEDB锁定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-14 18:57