<asp:textbox id=content runat=server textmode=multiline rows=5 columns=20 /> 在buttonclick中 sub buttonclick(sender as object, e as eventargs) dim thecontent as string thecontent=content.text thecontent=thecontent.replace(" "," ") thecontent=thecontent.replace("chr(13) ","<br>") //替换空格 strsql="insert into tables(content)values('" & thecontent & "') //替换回车换行 ............ end sub
其中的格式用html语法控制
在buttonclick中
sub buttonclick(sender as object, e as eventargs)
dim thecontent as string
thecontent=content.text
thecontent=thecontent.replace(" "," ")
thecontent=thecontent.replace("chr(13) ","<br>") //替换空格
strsql="insert into tables(content)values('" & thecontent & "') //替换回车换行
............
end sub
strshow=strshow.Replace("\n","<br/>");
strshow=strshow.Replace(" "," ");
strshow=strshow.Replace("\r\n","<br/>\r\n");myCommand.Parameters.Add(new SqlParameter("@文档内容", SqlDbType.NText));
myCommand.Parameters["@文档内容"].Value =strshow;