Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 combining fields in a select

Author  Topic 

fonzie
Starting Member

31 Posts

Posted - 2005-09-19 : 10:54:42
I have:
Dim queryString As String = "SELECT distinct [CSULOG5].[status] + [CSULOG5].[lmca_nbr] FROM [CSULOG5]" I even tried & instead of +.
but it doesn't like it. Is it legit syntax for mssqlserver?
This is a vb project aspnet

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-09-19 : 10:56:47
Do you get result when you run this in Query analyser?

SELECT distinct [CSULOG5].[status] + [CSULOG5].[lmca_nbr] FROM [CSULOG5]

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

fonzie
Starting Member

31 Posts

Posted - 2005-09-19 : 11:03:15
I got this:

Line 49: DropDownList1.DataTextField = "status+lmca_nbr"
Line 50: DropDownList1.DataSource = Goforit()
Line 51: DropDownList1.DataBind()


Go to Top of Page

fonzie
Starting Member

31 Posts

Posted - 2005-09-19 : 11:04:03
Line 51 was the error
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-09-19 : 11:04:56
Run that query in Query Analyser and see what happens

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

fonzie
Starting Member

31 Posts

Posted - 2005-09-19 : 11:15:49
Query Analyser? Is that part of enterprise mgr?
Go to Top of Page

fonzie
Starting Member

31 Posts

Posted - 2005-09-19 : 11:18:20
SELECT distinct [CSULOG5].[status] + [CSULOG5].[lmca_nbr] FROM [CSULOG5]

works just fine in the analyser
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-09-20 : 00:34:52
Then it is the problem with the code you use in ASP.NET

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -