|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
DataTable.ExpressionI am storing some information in a database, including the Expression's for columns in a DataTable. In this Expression, I want to display 2 fields, Address and Contact, but seperated by a new line, so the Contact appears on the line underneath Address. I have the following stored in my database for the DataColumn: 'Main Contact: ' + Contact + 'Main Address: ' + Address I have read the help on Expressions and it states that you can use \n for a new line and \r for a carriage return, but when I put these in the Expression I get an exception. Eg: 'Main Contact: ' + Contact + \r + 'Main Address: ' + Address gives me the following exception: Cannot find column [\r]. So my question is, how do I format the string in my database so when I set the DataColumn.Expression property it doesn't raise an exception and I get the 2nd column on a line underneath the 1st column? Thanks for any help. Kind Regards, Steve Steve Amey wrote:
Show quoteHide quote > Hi all I think the real question become, what are you displaying the data in. > > I am storing some information in a database, including the Expression's for > columns in a DataTable. In this Expression, I want to display 2 fields, > Address and Contact, but seperated by a new line, so the Contact appears on > the line underneath Address. > > I have the following stored in my database for the DataColumn: > 'Main Contact: ' + Contact + 'Main Address: ' + Address > > I have read the help on Expressions and it states that you can use \n for a > new line and \r for a carriage return, but when I put these in the > Expression I get an exception. Eg: > 'Main Contact: ' + Contact + \r + 'Main Address: ' + Address > gives me the following exception: > Cannot find column [\r]. > > So my question is, how do I format the string in my database so when I set > the DataColumn.Expression property it doesn't raise an exception and I get > the 2nd column on a line underneath the 1st column? > > Thanks for any help. > > Kind Regards, > Steve > > That is what is going to have to handle the carrage return. But to answer your immediate question you need to do is: 'Main Contact: ' + Contact + '\r' + 'Main Address: ' + Address Hi Steve
Try this: 'Main Contact: ' + Contact + '\r' + 'Main Address: ' + Address Maybe it helps? Martin
When I get the image from the file the file remains locked
Process that copies a prn file to a network printer under username Problem with SHAppBarMessage Is MDI child open or not? Impersonation without credentials ? BUG? SqlDecimal = Single/Double: 4.475 becomes 4.4749999999999996D ???? Generate reports programmatically with reporting services & SQL server 2005 VB.Net Setup Project VB.Net 2003 SetUp Project Unwelcome forced pauses during code development in VS 2005 |
|||||||||||||||||||||||