Solved

Adding a Table name to a the list

Posted on 2007-03-21
1
220 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

751 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