Output Columns

Jun 9, 2008 at 8:33 AM
Edited Aug 5, 2008 at 5:34 PM
Hi Team,

I have a stored procedure that looks somewhat like this:

[tb1].[Comment] AS 'Comment',
[tb1].[CreationDate] AS 'CreationDate',
[tb2].[URL] AS 'URL',
[tb3].[CompanyName] AS 'CompanyName',
[tb4].[WebsiteName] AS 'WebsiteName'
FROM [dbo].[TB1] [tb1] INNER JOIN
[dbo].[TB2] [tb2] ON [tb1].[Some_FK] = [tb2].[ID] INNER JOIN
[dbo].[TB3] [tb3] ON [tb2].[Website_FK] = [tb3].[ID] LEFT OUTER JOIN
[dbo].[TB4] [tb4] ON [tb4].[Company_FK] = [tb3].[ID]

I would like to use this to create a binding for a DataGridView in Windows Forms, but when I come to the Ouput Columns I get the names of the columns of the last three tables and I can't do anything with them. Is there some workaround I can get this to work?



UPDATE: I forgot I posted this, so I solved this with a view