我有用htmltxtbox框,为什么会提示:截断字符串或二进制数据?
哪怕我只输入一个字符也会提示?
在“企业管理器”中这个字段我设置为text但长度显示16而无法修改?
怎么解决?

解决方案 »

  1.   

    1. 截断字符串或二进制数据
       查看你的SQL语句是不是有问题,感觉是数据库报的错2. 设置为text但长度显示16而无法修
       这个类型的长度16表示16位的数据,并不表示只能输入16个字符,事实上可以输入上百兆的数据
      

  2.   

    SqlCommand myCommand= new SqlCommand("insert into tbl_Document([document_title],[document_text]) Values (@document_title,@document_text)",myConnection);             myCommand.Parameters.Add("@document_title",SqlDbType.VarChar,50).Value=txtDocumentTitle.Text;
                myCommand.Parameters.Add("@document_text",SqlDbType.Text).Value=txtDocumentText.Text;
                myCommand.Parameters.Add            myCommand.ExecuteNonQuery();  (卡在这句了)
      

  3.   

    将截断字符串或二进制数据。语句已终止。 
    说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Data.SqlClient.SqlException: 将截断字符串或二进制数据。语句已终止。源错误: 
     
    行 78:             myCommand.ExecuteNonQuery();
     
      

  4.   

    myCommand.Parameters.Add("@document_title",SqlDbType.VarChar,50).Value=txtDocumentTitle.Text;
                myCommand.Parameters.Add("@document_text",SqlDbType.Text).Value=txtDocumentText.Text;
                myCommand.Parameters.Add这里多了一句   myCommand.Parameters.Add 了