text type can not implement your requirement.
image type will be ok.seehttp://mail.ustc.edu.cn/~jtwu/jtwu/programs.htm

解决方案 »

  1.   

    说的是数据库已经订了,那个字段必须是文本类型,至于image类型我知道怎么作,还有谁能帮帮我?
      

  2.   

    用下列代码可以实现txt文件的正常入库,但是doc文件会出现乱码,谁能告诉我咱回事?!
    SqlConnection con=new SqlConnection(strConn2);
    string filename=UP_File.PostedFile.FileName;
    StreamReader sr=new StreamReader(filePath,Encoding.Default,true);
    String doc=sr.ReadToEnd();
    sr.Close();
    SqlCommand command=new SqlCommand();
    command.CommandType=CommandType.Text;
    command.Connection=con;
    command.CommandText="Update cx_jjsqb Set sqwj=@sqwj where bh=@maxbh";
    SqlParameter parambh=new SqlParameter("@maxbh",SqlDbType.Char,10);
    parambh.Value=maxbh;
    command.Parameters.Add(parambh);
    SqlParameter paramsqwj=new SqlParameter("@sqwj",SqlDbType.Text);
    paramsqwj.Value=doc;
    command.Parameters.Add(paramsqwj);
    con.Open();
    int RowsAffected=command.ExecuteNonQuery();
    con.Close();