Fondamentalement, j'ai une instruction d'insertion très simple quiC# avec INSERT procédure stockée r n problème
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)
L'entrée d'adresse dans le code C# est:
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();
La valeur Quoi qu'il en soit, quand j'insère ceci dans SQL, je retire le '\ r \ n' et je ne le veux pas car cela sera affiché plus tard et je veux que la ligne aks.
La colonne de base de données RECIPIENT_ADDRESS est nText
Quelqu'un at-il des idées?