When I run my code locally everything is fine, but the same code running externally I am getting a strange issue, instead of displaying a string ID on screen I am getting a message String or binary data would be truncated.
Below is a sample of the error:
http://www.mydomain.com/String or binary data would be truncated.~38249/
Functions.cs
public string EmailBodyPaymentLink(string sysId, bool forDisplay)
{
var sb = new StringBuilder();
sb.Append("<p><a href='" + "http://www.mydomain.com/pID~aID/'>PAY NOW</a></p>");
sb.Append("<p>If the link above is not clickable, please copy the following into the Address Bar of your chosen Internet Browser:</p>");
sb.Append("<p>http://www.mydomain.com/pID~aID/</p>");
}
HomeController.cs
var sbSql = new StringBuilder();
sbSql.Append("INSERT INTO [dbo].[Transactions] ");
sbSql.Append("([aID], [emailDate], [Amount], [dDate], [status], [systemID], [userID], [emailFrom]) ");
sbSql.Append("OUTPUT Inserted.[pID] ");
sbSql.Append("VALUES (");
sbSql.Append("'" + aId + "', '" + DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") + "', " + amount + ", '" + DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") + "', 'Email Sent', '" + sysId + "', '" + userDetails[1] + "', '" + emailFrom + "' ");
sbSql.Append(")");
string pId = _cf.RunSql(sbSql.ToString());
string strEmailBody = TempData["EmailHeader"].ToString().Replace("<span id='lblValue'></span>", amount) + "<p>" + emailBody + "</p>" + TempData["EmailFooter"].ToString().Replace("pID", pId).Replace("aID", aId);
This is bizarre, works locally with no issues whatsoever and I've published to our internal server via Visual Studio 2010 using FileSystem.
Any help would be much appreciated :-)