Solved

Adding a Table name to a the list

Posted on 2007-03-21
1
212 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

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

807 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