rt

解决方案 »

  1.   

    SqlCommand comm=new SqlCommand("insert into testgrid (UserName,provinceID) values(@UserName,@provinceID)",conn);
    SqlParameter parm1=new SqlParameter("@UserName",SqlDbType.Text);//估计你是在这里设置了长度显示,text类型和varchar类型不一样,不需要设置长度限制
    parm1.Value=this.TextBox1.Text;SqlParameter parm2=new SqlParameter("@provinceID",SqlDbType.NVarChar,50);
    parm2.Value=this.DropDownList1.SelectedValue;comm.Parameters.Add(parm1);
    comm.Parameters.Add(parm2);conn.Open();
    comm.ExecuteNonQuery();
    conn.Close();
      

  2.   

    to:singlepine(小山) ( ) 信誉:我是在sql的管理器里面设置表列的类型的。当选择text类型后系统就自动把“Length”设成:16而且不能改动
      

  3.   

    ntextVariable-length Unicode data with a maximum length of 230 - 1 (1,073,741,823) characters. Storage size, in bytes, is two times the number of characters entered. The SQL-92 synonym for ntext is national text.textVariable-length non-Unicode data in the code page of the server and with a maximum length of 231-1 (2,147,483,647) characters. When the server code page uses double-byte characters, the storage is still 2,147,483,647 bytes. Depending on the character string, the storage size may be less than 2,147,483,647 bytes.imageVariable-length binary data from 0 through 231-1 (2,147,483,647) bytes. 
    text的16不象varchar类型长度,16不是16个字符,而是2,147,483,647 bytes
      

  4.   

    text最大长度是(2,147,483,647)字符
      

  5.   

    text写不了那么多?是你设置错了呀,看看小山说的
      

  6.   

    我是把一个文章copy,然后直接在sql管理器中把表打开后贴到这个表的字段中去的,这样操作有问题吗
    另外我还设了一个主键是自动加1的,其它的应该没有问题吧,都是默认的啊!