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
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();
text的16不象varchar类型长度,16不是16个字符,而是2,147,483,647 bytes
另外我还设了一个主键是自动加1的,其它的应该没有问题吧,都是默认的啊!