Sunday, March 25, 2012

adding VbLf

When using the Xp_sendmail stored procedure from MS SQL 2000, I cannot use LF or CR of both otr VBnewLine in my messages.

For example

<code>
Trim(lblEmployee.Text) & " has requested a holiday. From " & CalendarPopupStartDate.SelectedDate & " till " & CalendarPopupStartDate.SelectedDate _
& "." & CARRIAGE RETURN WANTED &lblRequestedDays.Text & txtComments.Text
<code
where you find the CARRIAGE RETURN WANTED, I want to begin a new line. My email is not formated asked :(

any help?

Greetz,
Geoffyour looking for a CRLF

chr(13) & chr(10)|||yes I know. That is not the problem. The problem is that the xp_sendmail accepts a parameter @.message. this is build up from severall labels on my page. But I do not succeed in entering en CR or LF|||if your creating the message from a web page then use environment.newline to insert the CRLF|||SQL will parse it if you use CHAR(ascii)|||Yes I knwo that... I'll try to explain

When I build up a query I do this like this

Dim blabla as String = "Exec xp_sendmail @.message, @.and some others"
dim comBlaBla as sqlcommand(blabla , sqlconnection1)

----
Now when I fill up the parameter @. message and I use a char(10) or char(13) this is just printed as written in the string. I tried to use other characters that escaped these like \ and so one. Can someone give me an example of how I can add Lf or CR to a string that is passed as a parameter? Hopefully now you guys understand what I'm talking about.

Greets,
Geoff

No comments:

Post a Comment