Solved

Adding a Table name to a the list

Posted on 2007-03-21
1
192 Views
Last Modified: 2010-03-19
Hello Experts,

I have 3 tables in the database. Emp_Master,Dept_Master,Emp_salary. And I have a view which is shown below:

Select E.first_name,E.last_name,E.City,E.Age,D.Dept_Name,D.Dept_Code,ES.Salary,ES.Bonus,ES.LastBons from
Emp_Master E,Dept_Master D,Emp_salary ES
Where E.dept_id=D.Dept_id and E.emp_id=ES.Emp_id

I am displaying all the columns in a listbox in my ASPX page based on the query below:
SELECT column_Name as col,[dbo].[z360core_Get_CustomFieldAlias](column_Name) as ColumnName from Information_Schema.columns WHERE Table_Name=''EMPDeptView'' and Data_Type not In (''int'')

My question is, is there a way I can put a heading of the table Names as shown below in the Listbox:

Emp_Master
-------------------
First Name
Last Name
City
State
Dept_Master
-------------------
Dept_Code

 
0
Comment
Question by:rowmark
1 Comment
 
LVL 16

Accepted Solution

by:
Hillwaaa earned 500 total points
ID: 18813578
Hi rowmark,

Can't think of a way to do that in the drop-down list, would it be acceptable to display the tablename next to the column:

Emp_Master:First Name
Emp_Master:Last Name
Dept_Master:Dept_Code

Then you could just remove everything left of the ":"

Alternately, you could write it so that instead of one drop down, you have 2, the first holds the table names, then once a table is selected, the second is populated with the column names for just that table.

Cheers,
Hillwaaa
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now