Basically i've got a very simple insert statement which
INSERT INTO [dbo].[ORDER]
(ORDER_DATE
,ORDER_TYPE_ID
,PAYMENT_STATUS_ID
,TOTAL_COST
,SENDER_NAME
,SENDER_EMAIL
,SENDER_MESSAGE
,RECIPIENT_NAME
,RECIPIENT_ADDRESS)
VALUES
(@ORDER_DATE
,@ORDER_TYPE_ID
,@PAYMENT_STATUS_ID
,@TOTAL_COST
,@SENDER_NAME
,@SENDER_EMAIL
,@SENDER_MESSAGE
,@RECIPIENT_NAME
,@RECIPIENT_ADDRESS)
The address input in the C# code is:
Database db = DatabaseFactory.CreateDatabase();
DbCommand cmd = db.GetStoredProcCommand("sp_ORDER_INSERT");
db.AddInParameter(cmd, "@ORDER_DATE", DbType.DateTime, this._orderDate);
db.AddInParameter(cmd, "@ORDER_TYPE_ID", DbType.Int32, this._typeOfOrder.OrderTypeId);
db.AddInParameter(cmd, "@PAYMENT_STATUS_ID", DbType.Int32, this._statusOfPayment.PaymentStatusId);
db.AddInParameter(cmd, "@TOTAL_COST", DbType.Decimal, this._totalCost);
db.AddInParameter(cmd, "@SENDER_NAME", DbType.String, this._senderName);
db.AddInParameter(cmd, "@SENDER_EMAIL", DbType.String, this.SenderEmail);
db.AddInParameter(cmd, "@SENDER_MESSAGE", DbType.String, this._senderMessage);
db.AddInParameter(cmd, "@RECIPIENT_NAME", DbType.String, this._recipientName);
db.AddInParameter(cmd, "@RECIPIENT_ADDRESS", DbType.String, this._recipientAddress);
this._orderId = Convert.ToInt32(db.ExecuteScalar(cmd));
cmd.Dispose();
The value in this._recipientAddress
is a string of "address line 1 \r\naddress line2\r\n\r\naddressline3"
Anyway when I insert this into SQL it removed the '\r\n' and I don't want it to as this will get displayed later and I want the line breaks.
The RECIPIENT_ADDRESS database column is nText
Anyone got any ideas?