我数据库有2个二进制的字段   我分别用2个richtextbox显示出来,可是我在insert数据的时候添加了不同的数据,但是在显示的时候两个richtextbox显示同样的内容,而且都是显示第二个字段的内容,如果屏蔽第一个二进制字段连接数据库的select语句则不显示内容   不屏蔽就显示第二个字段的内容  为什么?  有人知道吗?  还有一个严重的问题就是  最后在查询的时候数据库里面的二进制数据总是显示最后新增的  不知道是覆盖了前面的还是怎样c#数据库insert

解决方案 »

  1.   

    上面那个@thwj  和@App   我修改过了的  我只是改一下看看是不是这里有问题  发现没问题
      

  2.   


     BinaryWriter bw = new BinaryWriter(File.Open("F:2.rdlc",FileMode.OpenOrCreate));
                bw.Write(CheckInfo.by1);
                bw.Close();
                this.richTextBox1.Paste();
     BinaryWriter bw = new BinaryWriter(File.Open("F:2.rdlc",FileMode.OpenOrCreate));
                bw.Write(CheckInfo.by2);
                bw.Close();
                this.richTextBox2.Paste();
    这是显示的代码  求各位高手帮忙解决
      

  3.   


     SqlCommand cmd = new SqlCommand("select 申请项目文件 from BaseInfo where 编号=" + this.编号TextBox.Text + "", conn);
                by2 = (byte[])cmd.ExecuteScalar();
                ApplyPic ap = new ApplyPic();
                ap.Show();SqlCommand cmd = new SqlCommand("select 合同文件 from BaseInfo where 编号=" + this.编号TextBox.Text + "", conn);
                by1 = (byte[])cmd.ExecuteScalar();
                CovPic cp = new CovPic();
                cp.Show();
      

  4.   


    我发现问题了  问题在于  就是我的2个richtextbox指挥显示最近我复制的内容  根本就不是现实数据库里面的内容   我该怎么解决?
      

  5.   

    你两次读的好象都是F:2.rdlc呀?文件名改为F:1.rdlc试试
      

  6.   

    Clipboard.SetText("file1");
                richTextBox1.Paste();
                Clipboard.SetText("file2");
                richTextBox2.Paste();
      

  7.   


    1检查文件名引用是否错误.
    2paste后加上ClipBoard.Clear()
      

  8.   

    这代码写的....
    自己都弄不懂自己写的代码
    赋值全用 粘帖板内容?
    你这个代码 和 你读写数据库有任何关系么?File.Open("F:2.rdlc",FileMode.OpenOrCreate) 这个有何用 堵这个文件里的东西么
      

  9.   


    你读了数据库
     SqlCommand cmd = new SqlCommand("select 申请项目文件 from BaseInfo where 编号=" + this.编号TextBox.Text + "", conn);
                by2 = (byte[])cmd.ExecuteScalar();然后呢BinaryWriter bw = new BinaryWriter(File.Open("F:2.rdlc",FileMode.OpenOrCreate));            bw.Write(CheckInfo.by1);    
            bw.Close();        
        this.richTextBox1.Paste……读了一个无关的文件最后 用粘帖板里的内容去赋值
    3步操作 各不相关
    能显示你要的结果都怪了