c#中如何TextBox中輸入的換行符存入access數據庫

C#中有一TextBox,屬性設置MultiLine=True,Wrap=True,現在要把TextBox中輸入的回車存入ACCESS數據庫的備注字段中,代碼如下:
                                                    
              string tempnr=TextBox1.Text;
                         tempnr.Replace("\r","<br>").Replace("\n","<br>");

这样情况下 自动回车换行就不会起作用,

 

                         tempnr.Replace("\r","").Replace("\n","");
                 这样情况下自动回车换行就起作用了,   

posted @ 2009-02-26 11:46  天涯海客  阅读(263)  评论(0编辑  收藏  举报