innonet
Posts: 55
|
| Posted: 12/10/2010, 1:47 PM |
|
I have a listbox which retrieves the values from several tables. And instead of having one long line, I would like to display them in tabs, e.g.
John Stewart Employee New York
Paula Miller Employee Miami
Peter Stauer Employee Atlanta
Right now it is displayed as follows when I click on the listbox:
John Stewart Employee New York
I know there is a Microsoft SQL Command which I add to the SELECT. But due to a brainfart I am not able to remember it.
We are using ASP.net C# Inmotion and MSSQL 2008. If there is another way to go please send me your suggestions !
PLEASE, any help is super appreciated.
|
 |
 |
datadoit
|
| Posted: 12/10/2010, 2:29 PM |
|
Probably something like SELECT
CONCAT(field1,Nchar(9),field1,Nchar(9),field3) AS Text
|
|
|
 |
innonet
Posts: 55
|
| Posted: 12/13/2010, 7:05 AM |
|
Hi there,
thank you for your reply. But Microsoft SQL Server does not know a CONCAT command !
Please, any help or input is appreciated.
|
 |
 |
datadoit
|
| Posted: 12/13/2010, 11:01 AM |
|
My bruthah! http://www.google.com/#q=sql+server+concatenate
|
|
|
 |
innonet
Posts: 55
|
| Posted: 12/13/2010, 12:22 PM |
|
Hi Datadoit,
the problem is NOT to retrieve the values but to display them in a tabbed view within the list box, e.g.
Paul ........... Miller ..........Chicago
John ...........Harper .......Miami
Sandra .......Kozlak .......Atlanta
Right now I get which is hard to read if you have 20+ listings.
Paul Miller, Chicago
John Harper, Miami
Sandra Kozlak, Atlanta
PS: The dots above represent the space (the textbox here removes empty space)
Any new input ????????????
|
 |
 |
datadoit
|
| Posted: 12/13/2010, 1:31 PM |
|
Did you try: SELECT field1 + Nchar(9) + field2 + Nchar(9) + field3
that should put tabs between each field.
Ref: http://www.simple-talk.com/sql/t-sql-programming/concat...n-transact-sql/
|
|
|
 |
innonet
Posts: 55
|
| Posted: 12/13/2010, 2:01 PM |
|
Yes, I have tried that. I don't get any error but it displays everything in a single long row.
|
 |
 |
ReneS
Posts: 225
|
| Posted: 12/14/2010, 11:42 AM |
|
Hi,
In the datasource of the listbox, custum sql, something like SELECT "field1" + " "' + "field2" + "' " + "field3"
or: something like SELECT "field1" + "\t"' + "field2" + "'\t" + "field3" (\t with or without quotes...)
or: something like SELECT "field1" + (char)9 + "field2" + (char)9 + "field3"
Hope there is something...
Rene
|
 |
 |
CodeChargeMVP
Posts: 473
|
| Posted: 12/17/2010, 10:34 AM |
|
Hi,
Realise than on the php code page, there´s the code related to the components than you have
on the html view, realise than this code owns every form and inside every form exists differents
functions, so check out this php code pages, find where the object is declared and than you
can modify the SQL Statemente there (Realise than if you modify some function from php code
page,it´ll stop working the autogeneration code).
_________________
Best Regards
Entrepeneur | NT Consultant
|
 |
 |
|